[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

div tag being pushed down

Posted on 2011-02-23
4
Medium Priority
?
224 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 2000 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

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!
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
In this tutorial viewers will learn how to customize the background color and font color of highlighted text using the ::selection element in CSS Begin by defining the selected text as an element in CSS by typing "::selection": Style the ::selection…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses

656 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