Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    UE Antagonizer Fumigator's Avatar
    Join Date
    Dec 2005
    Location
    Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
    Posts
    7,691
    Thanks
    42
    Thanked 637 Times in 625 Posts

    Keeping the leftbar in line using IE6

    More CSS fun.

    I used a layout (#31) from the Layout Gala and it works fine, but when I try to center the top level <div> and add margins on left and right, IE6 messes up the left sidebar. (By messes up I mean it truncates the box on the left, and resizing the window causes the box to migrate across the window.) FF is fine with the change. I haven't tested any other browsers.

    My question: Is there a way I can center the top level div (id="container") and keep IE6 from messing the left bar up?

    Here is the page code, with the additional formatting added by me in red:
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en-us">
    <head>
    <title>Prototype</title>
    <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"/>
    
    <style type="text/css">
    
    html {
    	margin: 0;
    	padding: 0;
    	background: #ffffff;
    	color: #000;
    }
    
    body {
    	font: 76% verdana, tahoma, arial, sans-serif;
    	text-align:center;
    	margin: 0;
    	padding: 0;
    	background: #ffffff;
    	color: #000;
    }
    
    p {
    	margin: 0 10px 10px;
    	font-size: 1.15em;
    	letter-spacing: 0em;
    	word-spacing: 0em;
    }
    
    div#container {
    	width: 95%;
    	margin: 0 auto; 
    	text-align: left;
    	background: #fff;
    }
    
    div#wrapper {
    	float: left;
    	width: 100%;
    }
    
    div#header {
    	height: 75px;
    	margin: 0;
    	padding: 0;
    	color: #fff;
    	font-family: "trebuchet MS", verdana, tahoma, sans-serif;
    	width: 100%;
    	float: left;
    	background: #33c url(img/header_bg1.jpg); 
    }
    
    div#menudiv {
    	float: left;
    	width: 100%;
    	background: #fc6;
    	color: #000;
    	margin: 2px 0px 0px 0px;
    	padding: 0;
    	font-family: "trebuchet MS", Verdana, Arial, sans-serif;
    }
    
    div#fullcontent {
    	width: 99.8%;
    	border: 1px dotted #4c4c94;
    	float: left;
    	margin: 0 0 10px 0;
    	clear: both;
    	padding: 0;
    	background: #fff url(img/rightgrayfade.jpg) right repeat-y;
    	
    }
    
    div#content {
    	margin-left:200px;
    	border: 1px dotted #4c4c94;
    	background: #fff url(img/rightgrayfade.jpg) right repeat-y;
    	padding 0 0 100px 0;
    }
    
    div#leftbar {
    	float:left;
    	border: 1px solid #4c4c94;
    	width:195px;
    	margin-left:-100%;
    	padding-bottom: 100px;
    	background: #d2d6e8;
    }
    
    div#footer {
    	background: #fff;
    	margin: 10px 0px 10px 0px;
    	color: #000;
    	clear: both;
    	width: 100%;
    	float: left;
    	font-size: .8em;
    	padding: 0px 0px 5px 0px;
    	border-top: 10px solid #eee;
    	border-bottom: 10px solid #eee;
    }
    	
    div#footer p {
    	margin: 0;
    	padding: 5px 10px;
    	text-align: center;
    }
    
    .headtitle {
    	float: left;
    	display: inline;
    	text-align: center; 
    	width: 100%;
    }
    
    .headtitle a {
    	color: #ffffc0 !important;
    }
    
    .headtitle h1 {
    	font-size: 3.1em; 
    	font-weight: bold;
    	margin: 5px 0 5px 0;
    }
    
    </style>
    
    </head>
    <body>
    
    <div id="container">
    <div id="header">
    	<div class="headtitle">
    		<h1>Troy Yates.com</h1>
    	</div>
    </div>
    
    <div id="wrapper">
    <div id="content">
    
    Ipsum Lorem.
    
    </div>
    </div>
    
    		<div id="leftbar">
    			Ipsum Lorem.
    		</div>
    
    		<div id="footer">
    			Ipsum Lorem.
    		</div>
    </body>
    </html>

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,865
    Thanks
    160
    Thanked 2,224 Times in 2,211 Posts
    In your code, there is missing of a </div>. (container)
    Anyway I think you've missed a serious/useful discussion opened by vtjustinb regarding float.
    Floats aren't always the answer

    I've downloaded the same layout and modified as
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <head>
    <title>Layout 31</title>
    <meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
    <meta name="generator" content="HAPedit 3.1">
    <style type="text/css">
    html,body{margin:0;padding:0}
    body{font: 76% arial,sans-serif}
    #container{
    	width: 95%;
    	margin: 0 auto; 
    	position:relative;
    	text-align: left;
    	background: #fff;
    }
    p{margin:0 10px 10px}
    a{display:block;color: #981793;padding:10px}
    div#header h1{height:80px;line-height:80px;margin:0;
      padding-left:10px;background: #EEE;color: #79B30B}
    div#content p{line-height:1.4}
    div#navigation{background:#B9CAFF}
    div#extra{background:#FF8539}
    div#footer{background: #333;color: #FFF}
    div#footer p{margin:0;padding:5px 10px}
    
    div#wrapper{/*float:left;width:100%*/margin-left:200px;}
    div#content{/*margin-left:200px*/}
    div#navigation{float:left;width:200px;}
    div#extra{clear:left;width:100%}
    </style>
    </head>
    <body>
    <div id="container">
    	<div id="header"><h1>Header</h1></div>
    	
    	<div id="navigation">
    		<p><strong>2) Navigation here.</strong> long long fill filler very fill column column silly filler very filler fill fill filler text fill very silly fill text filler silly silly filler fill very make fill column text column very very column fill fill very silly column silly silly fill fill long filler </p>
    	</div>
    	
    	<div id="wrapper">
    		<div id="content">
    			<p><strong>1) Content here.</strong> column long long column very long fill fill fill long text text column text silly very make long very fill silly make make long make text fill very long text column silly silly very column long very column filler fill long make filler long silly very long silly silly silly long filler make column filler make silly long long fill very.</p>
    			<p>very make make fill silly long long filler column long make silly silly column filler fill fill very filler text fill filler column make fill make text very make make very fill fill long make very filler column very long very filler silly very make filler silly make make column column </p>
    			<p>fill long make long text very make long fill column make text very silly column filler silly text fill text filler filler filler make make make make text filler fill column filler make silly make text text fill make very filler column very </p>
    			<p>column text long column make silly long text filler silly very very very long filler fill very fill silly very make make filler text filler text make silly text text long fill fill make text fill long text very silly long long filler filler fill silly long make column make silly long column long make very </p>
    		</div>
    	</div>
    	
    	<div id="extra">
    		<p><strong>3) More stuff here.</strong> very text make long column make filler fill make column column silly filler text silly column fill silly fill column text filler make text silly filler make filler very silly make text very very text make long filler very make column make silly column fill silly column long make silly filler column filler silly long long column fill silly column very </p>
    	</div>
    	<div id="footer"><p>Here it goes the footer</p></div>
    </div>
    </body>
    </html>
    Hope this may help.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • Users who have thanked abduraooft for this post:

    Fumigator (10-29-2007)

  • #3
    UE Antagonizer Fumigator's Avatar
    Join Date
    Dec 2005
    Location
    Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
    Posts
    7,691
    Thanks
    42
    Thanked 637 Times in 625 Posts
    Your post did help, quite a bit in fact.

    I played with the positioning thing a bit. My problem is I hate CSS because of the lack of consistent support across browsers but I acknowledge its power and utility. But because I hate it, I have a tough time getting all absorbed with the nuances that seem to be required to make things work. It should be incredibly simple and straight-forward to get a simple 2 column fluid/fixed layout to work properly. Instead, it's a greek tragedy.

    Implementing your altered layout almost works, but introduces the peekaboo bug in IE6. As I understand that bug, there are 2 or 3 solutions. I tried them all, and they all give me some different kind of issue, one of which shows up in FF. So now I'm forced to hack to put the fix in just for IE but not for FF. Blech.

    As you can probably tell I've had it with CSS and I am at the point where I'm going back to using tables for my layouts. OK just kidding... but I'm almost at that point. At least tables behave consistently across most browsers...

    I think I'll look around for another way to do a fluid layout with a fixed left column that allows left/right margins.

  • #4
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,865
    Thanks
    160
    Thanked 2,224 Times in 2,211 Posts
    I've used http://bonrouge.com/2c-hf-fluid.php , and exhibits no problem on adding margin:0pt auto;width:90%; to #wrap.
    (But you may have to include the inner blocks,if any, of center column in the IE6 hack- zoom:1;, if you have extra bg-color for those elements.)
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #5
    UE Antagonizer Fumigator's Avatar
    Join Date
    Dec 2005
    Location
    Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
    Posts
    7,691
    Thanks
    42
    Thanked 637 Times in 625 Posts
    Awesome thank you, I will try that out. I have tried 3 different layouts and they all break in some way or other when I add my super special form CSS that I got from jeffhowden.com, which I just absolutely love. Unfortunately the form CSS just does not like to play with the CSS of a fluid layout. I've conceded this fact and built a fixed width centered layout, which works great. I will try out the Bonrouge layout-- maybe it will be my golden goose... otherwise I'll just stick to fixed width columns (for this project anyway).

    p.s. I wonder if CSS3 will improve the state of affairs at all? Or just muddy the waters yet further?

  • #6
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,865
    Thanks
    160
    Thanked 2,224 Times in 2,211 Posts
    Ha.. Ha.. the above site is quite funny!
    I scrolled down the page in FF, and when the scroll bar reached in to the bottom(where CSS displayed), the bee is being cut in to two pieces for a while, and then joins.
    Last edited by abduraooft; 11-01-2007 at 04:26 PM.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •