This forum is now read-only. Please use our new forums! Go to forums

0 points
Submitted by Maxime Germain
over 8 years

[resolved] I can't seem to find a background image that fits for jumbotron.

I even searched for images with the same dimensions as the example image. How do I make it fit?

Answer 55af5466e39efe84020002cc

2 votes
Best answer

Permalink

Hello Maxime,

you can do it in a few different ways, I would use the code

img {
    width: 100%;
    height: auto;
}

but this will make all your images fill 100% of the allowed space so use with caution. Maybe be a bit more specific and use .jumbotron img

You can also try some websites like unsplash.com as they do big free to use images

Thanks

points
Submitted by Keith Light
over 8 years

1 comments

Ishknits over 8 years

So where would I add this img element? The link to the jumbotron background image is IN the CSS file, not the HTML file. I can add a .jumbotron img even if there’s no img in the jumbotron div?

Answer 55af979a9113cb4f8c0005af

0 votes

Permalink

Thank you!

points
Submitted by Maxime Germain
over 8 years

1 comments

Keith Light over 8 years

no worries! Just be careful with over-stretching a small image, as well as being careful about image size in case people are viewing on mobile. I usually find a balance between the two