Dayal
Dayal

Reputation: 3

HTML not resizing width of image

When I make the screen of my browser smaller my image width will not become smaller and I have been trying to use this:

CSS:

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

html:

<img src = "112TP.png" alt = "Shin-Dor Soccer Image">

Anyone know why?

Upvotes: 0

Views: 36

Answers (1)

shai_sharakanski
shai_sharakanski

Reputation: 417

Try this:

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

in CSS you have to write ";" after every line

Upvotes: 1

Related Questions