pee2pee pee2pee - 1 year ago 87
CSS Question

Image to Fit Containing Div

I have done this many times before but it doesn't seem to work now for whatever reason. I want the image to be the full the width of the container but it doesn't. Any ideas?



img {
max-width: 100%;
max-height: 100%;
div {
background: #ccc;

<img src="" class="full-width">

Answer Source

Just add width:100% to img

img {
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download