Solved

overflow: hidden not working as I expect

Posted on 2012-04-13
3
210 Views
Last Modified: 2012-05-02
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.
0
Comment
Question by:HDM
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 38

Expert Comment

by:Tom Beck
ID: 37844537
Try this:

.PreviewCell img {
    display: block;
    height: 100%;
    margin-top: 2%;
    position: relative;
    top: 2px;
    width: 100%;
}
0
 

Author Comment

by:HDM
ID: 37857386
That didn't work. I wound up using a negative bottom margin.

.PreviewCell img
{
	display:inline-block;
	width:100%;
	height:100%;
	margin-bottom:-4%;
}

Open in new window


And that worked where using a positive top margin didn't. I'm not sure why, in fact I find it rather confusing.
0
 
LVL 1

Accepted Solution

by:
nzwebbie earned 500 total points
ID: 37859821
Hi, the second comment on the following page I like and might have the solution you were after...
http://stackoverflow.com/questions/57725/how-can-i-display-just-a-portion-of-an-image-in-html-css
0

Featured Post

Report: Liquid Web beats Amazon, Rackspace & More

A study by performance analyst firm Cloud Spectator finds that Liquid Web beats rivals Amazon, Rackspace and DigitalOcean when it comes to website and cloud application performance.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Node.js 11 82
HTML INPUT 6 39
Div not showing up 6 33
MSDeploy "The underlying connection was closed: The connection closed unexpectedly" 1 8
Color can increase conversions, create feelings of warmth or even incite people to get behind a cause. If you want your website to really impact site visitors, then it is vital to consider the impact color has on them.
Although a lot of people devote their energy toward marketing for specific industries, there are some basic principles that can be applied to any sector imaginable. We’ll look at four steps to take and examine how those steps were put into action fo…
In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question