Curtis Long
asked on
overflow: hidden not working as I expect
I have a html page that displays a list of images generated by a server, but I don't want to display the bottom 2% of the image. My solution was to use overflow:hidden on the containing div for the image and then to give the image a 2% margin-top after setting it to display:inline-block. This worked great for a simple proof of concept page I built, but not so much for the actual page.
A link for the working page:
Working page
A link for the non working page:
non-working
My end goal is to get rid of the white line on the bottom of each image on the non-working page.
A link for the working page:
Working page
A link for the non working page:
non-working
My end goal is to get rid of the white line on the bottom of each image on the non-working page.
ASKER
That didn't work. I wound up using a negative bottom margin.
And that worked where using a positive top margin didn't. I'm not sure why, in fact I find it rather confusing.
.PreviewCell img
{
display:inline-block;
width:100%;
height:100%;
margin-bottom:-4%;
}
And that worked where using a positive top margin didn't. I'm not sure why, in fact I find it rather confusing.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
.PreviewCell img {
display: block;
height: 100%;
margin-top: 2%;
position: relative;
top: 2px;
width: 100%;
}