Reputation: 3966
I am working on a responsive layout and I want my images to fill their containers. When I use max-width
and no height
there is some empty space near the bottom of the images.
Here is a fiddle: http://jsfiddle.net/8SvpQ/
Is what I am doing not possible to accomplish?
Upvotes: 1
Views: 2629
Reputation: 31
just place and be happy =)
.img_h img{
display: block;
}
Here an example : http://goo.gl/PqYIkN
I have helped
Upvotes: 1
Reputation: 1156
What you are trying to do is possible. And it has been done on this page Make responsive image fit parent container. Hope this helps. please comment back if you do need help or tell me this is useful or not. thanks
Upvotes: 0
Reputation: 7180
I always use width:100%;
with height:auto;
and display:block;
img {
max-width: 100%;
margin: 0;
padding: 0;
/* ADD THIS */
width:100%;
height:auto;
display:block;
}
display:block;
will remove some unwanted box-model
spacing under the image
Upvotes: 2