Solved

div tag being pushed down

Posted on 2011-02-23
4
219 Views
Last Modified: 2012-05-11
I want to have a sidebar and main contents to display all the way at the top of the page.  However-only sometimes-(iE8) the main content has a large white space and starts displaying only below the sidebar content,
.twoColHybLt #container { 
	margin: 0 auto; /* the auto margins (in conjunction with a width) center the page */
	text-align: left; /* this overrides the text-align: center on the body element. */
} 
.twoColHybLt #sidebar1 {
	float: left; 
	width: 18%; /* since this element is floated, a width must be given */
	padding: 0px 0;  /*top and bottom padding create visual space within this div  */
}
.twoColHybLt #sidebar1 h3, .twoColHybLt #sidebar1 p {
	margin-left: 10px; /* the left and right margin should be given to every element that will be placed in the side columns */
	margin-right: 10px;
}

.twoColHybLt #mainContent { 
	margin: 0 20px 0 12em;  /*the right margin can be given in percentages or pixels. It creates the space down the right side of the page. */
	  
}

Open in new window

0
Comment
Question by:JSCF
[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
4 Comments
 
LVL 16

Expert Comment

by:HagayMandel
ID: 34962571
It happens because the sidebar div has a content component that is wider than it's with (18%)
To verify it, use overflow:hidden in the sidebar style.
0
 
LVL 16

Accepted Solution

by:
HagayMandel earned 500 total points
ID: 34962588
It happens because the sidebar div has a content component that is wider than its width (18%)
To verify it, use overflow:hidden in the sidebar style.
[problems with my keyboard]
0
 

Author Comment

by:JSCF
ID: 34963284
Why does it happen onl yin IE8?
0
 
LVL 16

Expert Comment

by:HagayMandel
ID: 34963681
Cause other browsers usually crop the extra width.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This is a how to build your own CSS3 slideshow and when I say CSS3 I mean just CSS with no javascript in sight! There a few examples online of how to do this but most just show you an example without any explanation, others make it more complicat…
So you have coded your own WordPress plugin and now you want to allow users to upload images to a folder in the plugin folder rather than the default media location? Follow along and this article will show you how to do just that!
In this tutorial viewers will learn how add a full-size background image to a webpage using CSS3. Create a new HTML document with an internal stylesheet.: In CSS, define the html element to have a background image. Use a high resolution image.: In t…
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…

733 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