CSS issue

Out of context: Reply #2

  • Started
  • Last post
  • 3 Responses
  • mekk0

    nope, background-scaling is not possible, the only way to do it would be to put an img inside the element you want to scale and give it 100% width (or height/both) and then it will inherit the size of the parent-element:

    <div style="width: 100px;">
    <img src="a.jpg" style="width: 100%;" />
    </div>

    so then the <img> would be 100px wide and the height will be scaled proportionally

    when you use overflow:hidden; and max-width on the <div> you can make sure that the <img> won't blow it up.

    You want to have a filled and resized background, won't you? ;) if that's the case you have to do a little more to get that working 100% correctly..

View thread