#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Posts
    1
    Rep Power
    0

    CSS: IE6 positioning problem


    I'm trying to create a simple two column + header layout. The left column contains navigation and has a fixed width. The right column contains content and fills the remaining width of the page. The header also contains navigation, in text form. Due to the textual navigation within the header, the left and right column cannot be positioned absolutely (as in the bluerobot layout resevoir) as the user may alter the text size, causing the header to encroach on the left & right columns; I have therefore wrapped them in a relatively positioned parent/containing div (#wrapper) so they can be positioned according to this containing block's boundaries. This works fine on all browsers - apart from IE6, which seems to have problems with the containing block. Here's a stripped down version of the code I'm using:

    Code:
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
    	<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
    	<title>Untitled</title>
    	
    	<style type="text/css" media="Screen">
    	body {
    	  margin:0;
    	  padding:0;
    	  }
    	
    	#header {background-color:#eee;}
    	
    	#wrapper {
    	  position:relative;
    	  clear:both;
    	  }
    
    	#left {
    	  position: absolute;
    	  top: 0; left: 0;
    	  width:270px;
    	  background-color:#ccc;
    	  }
    		
    	#right {
    		margin-left: 270px;
    		background-color:#666;
    	  }
    	
    	p, ul {margin: 0;}
    	</style>
    </head>
    <body>
    	
    	<div id="header">HEADER</div>
    	
    	<div id="wrapper">
    	
    		<div id="left">
    			<ul>
    				<li>option 1</li>
    				<li>option 1</li>
    				<li>option 1</li>
    				<li>option 1</li>
    			</ul>
    		</div>
    		
    		<div id="right">
    			<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.  Proin fermentum euismod mauris. Sed vel metus vel wisi tincidunt convallis. Cras rutrum tortor non nulla. Duis nunc dui, iaculis vel, vehicula ac, fermentum vitae, metus. Fusce urna lacus, commodo a, viverra accumsan, varius mollis, quam. Aliquam at tortor. Donec at lacus. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Sed commodo. Duis imperdiet nonummy nulla. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos hymenaeos.  </p>
    		</div>
    	
    	</div>
    
    </body>
    </html>
    I'm sure this is something simple....but I can't see it...can anyone help?
    Attached Files
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2003
    Posts
    22
    Rep Power
    0
    This may not answer your question directly, but...

    I use ems to set the top of the divs that flow under the header. If the size of the text in the header changes, the two divs under it also move.

    Code:
    #col1
    {
       position:absolute;
       top:5ems;
       left:0;
    }
    #col2
    {
       position:absolute;
       top:5ems;
       left:30%;
    }

IMN logo majestic logo threadwatch logo seochat tools logo