user9757285
user9757285

Reputation:

how do I make images fit the browser and resize?

I can't find how to make the image fit the browser as it it currently cropping it and resize with the browser

webpage currently

<div class="contentwrapper">
<img src="img/1.%20Self%20Branding%20display2.png">
</div>

.contentwrapper {
position: relative;
margin:0 auto;
width:97vw;
height: 100%;

}

Upvotes: 1

Views: 68

Answers (1)

ToN
ToN

Reputation: 26

Try using max-width and height.

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

Upvotes: 1

Related Questions