Reputation: 33
I've got two big css image hovers... and I want the images to be max-width:100% (for phones). I can make the divs max-width 100% but then the image inside them just logically gets cut off by the div edge. How can I make sure that the image (in this case a background-image) in the div also does the 100% max-width?
Demo: http://www.buzz-creative.nl/_test/index.html
Thanks in advance!
Upvotes: 0
Views: 1610
Reputation: 14575
This uses background-size: 100% to make the background image fill the div, the only problem with this is you have to specify height and width, as there is no content in the div so it wants to be 0px by 0px
Upvotes: 1
Reputation: 623
try, background-size:auto;
link http://www.css3.info/preview/background-size/
Upvotes: 0