Redesigning Parent's business website

break between header and navbar only in IE6

Page 1 of 1

6 Replies - 1215 Views - Last Post: 13 April 2009 - 12:50 PM

#1 hullabaloo2  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 27-March 09

Redesigning Parent's business website

Posted 06 April 2009 - 01:48 AM

I'm redesigning the website for my parent's business. I'm using a dreamweaver cs3 template. I have only input the header graphic and the navbar graphics so far, and I have everything working fine for Google Chrome, Fire Fox 3, IE7; however, for some reason there is a break in the header <div> in IE6. I tried several different settings in the exception list, but that didn't work. Does anyone know how I can fix this?

http://www.bkpetnece...x/newstyle.html

CSS code
<style type="text/css"> 
<!-- 
body  {
	font: 100% Verdana, Arial, Helvetica, sans-serif;
	background: #e9ead4;
	margin: 0; /* it's good practice to zero the margin and padding of the body element to account for differing browser defaults */
	padding: 0;
	text-align: center; /* this centers the container in IE 5* browsers. The text is then set to the left aligned default in the #container selector */
	color: #000000;
}
.twoColFixLtHdr #container { 
	width: 807px;  /* using 20px less than a full 800px width allows for browser chrome and avoids a horizontal scroll bar */
	background: #FFFFFF;
	margin: 0 auto; /* the auto margins (in conjunction with a width) center the page */
	border:none;
	text-align: left; /* this overrides the text-align: center on the body element. */
} 
.twoColFixLtHdr #header { 
	height: 135px;
	background: #DDDDDD; 
	
	  /* this padding matches the left alignment of the elements in the divs that appear beneath it. If an image is used in the #header instead of text, you may want to remove the padding. */
} 
.twoColFixLtHdr #header h1 {
	margin: 0px; /* zeroing the margin of the last element in the #header div will avoid margin collapse - an unexplainable space between divs. If the div has a border around it, this is not necessary as that also avoids the margin collapse */
	padding: 10px 0pxs; /* using padding instead of margin will allow you to keep the element away from the edges of the div */
}
.twoColFixLtHdr #navbar { 
	height: 30px;
	padding: 0px 0px 0px 0px; /* this padding matches the left alignment of the elements in the divs that appear above it. */
	background:#e9ead4; 
	background-image:url(images/navbg.gif);
	background-repeat:repeat-x;
} 
.twoColFixLtHdr #navbar p {
	margin: 0; /* zeroing the margins of the first element in the footer will avoid the possibility of margin collapse - a space between divs */
	padding: 10px 0; /* padding on this element will create space, just as the the margin would have, without the margin collapse issue */
}
.twoColFixLtHdr #sidebar1 {
	float: left; /* since this element is floated, a width must be given */
	width: 174px; /* the actual width of this div, in standards-compliant browsers, or standards mode in Internet Explorer will include the padding and border in addition to the width */
	background: #EBEBEB; /* the background color will be displayed for the length of the content in the column, but no further */
	padding: 15px 10px 15px 20px;
}
.twoColFixLtHdr #mainContent { 
	margin: 0 0 0 199px; /* the left margin on this div element creates the column down the left side of the page - no matter how much content the sidebar1 div contains, the column space will remain. You can remove this margin if you want the #mainContent div's text to fill the #sidebar1 space when the content in #sidebar1 ends. */
	padding: 0 20px; /* remember that padding is the space inside the div box and margin is the space outside the div box */
} 
.twoColFixLtHdr #footer { 
	padding: 0 0px 0 20px; /* this padding matches the left alignment of the elements in the divs that appear above it. */
	background:#DDDDDD; 
} 
.twoColFixLtHdr #footer p {
	margin: 0; /* zeroing the margins of the first element in the footer will avoid the possibility of margin collapse - a space between divs */
	padding: 10px 0; /* padding on this element will create space, just as the the margin would have, without the margin collapse issue */
}
.fltrt { /* this class can be used to float an element right in your page. The floated element must precede the element it should be next to on the page. */
	float: right;
	margin-left: 8px;
}
.fltlft { /* this class can be used to float an element left in your page */
	float: left;
	margin-right: 8px;
}
.clearfloat { /* this class should be placed on a div or break element and should be the final element before the close of a container that should fully contain a float */
	clear:both;
	height:0;
	font-size: 1px;
	line-height: 0px;
}
--> 
</style>


CSS exception code
<!--[if IE 5]>
<style type="text/css"> 
/* place css box model fixes for IE 5* in this conditional comment */
.twoColFixLtHdr #sidebar1 { width: 230px; }
</style>
<![endif]--><!--[if IE]>
<style type="text/css"> 
/* place css fixes for all versions of IE in this conditional comment */
.twoColFixLtHdr #sidebar1 { padding-top: 30px; }
.twoColFixLtHdr #mainContent { zoom: 1; }
.twoColFixLtHdr #header { height: 135px;
							width: 807px;}
.twoColFixLtHdr #header { margin: 0px;}
.twoColFixLtHdr #header { padding: 0px;}
.twoColFixLtHdr #header { vertical-align:bottom; }
.twoColFixLtHdr #navbar { height: 30px;
							width: 807px; }



/* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */
</style>
<![endif]-->


HTML code
</head>

<body class="twoColFixLtHdr">

<div id="container">
  <div id="header">  
  <img src="images/finalheader.jpg" width="807" height="135" alt="header" />
  <!-- end #header --></div>
  
  <div id="navbar">
	<img class="fltlft" src="images/navbarleft.gif" alt="" />
	<img class="fltrt" src="images/navbarright.gif" />
	
   asfasdfas</div>
  
  <div id="sidebar1">
	<h3>Sidebar1 Content</h3>
	<p>The background color on this div will only show for the length of the content. If you'd like a dividing line instead, place a border on the left side of the #mainContent div if it will always contain more content. </p>
	<p>Donec eu mi sed turpis feugiat feugiat. Integer turpis arcu, pellentesque  eget, cursus et, fermentum ut, sapien. Fusce metus mi, eleifend  sollicitudin, molestie id, varius et, nibh. Donec nec libero.</p>
  <!-- end #sidebar1 --></div>
  <div id="mainContent">
	<h1> Main Content </h1>
	<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Praesent aliquam,  justo convallis luctus rutrum, erat nulla fermentum diam, at nonummy quam  ante ac quam. Maecenas urna purus, fermentum id, molestie in, commodo  porttitor, felis. Nam blandit quam ut lacus. Quisque ornare risus quis  ligula. Phasellus tristique purus a augue condimentum adipiscing. Aenean  sagittis. Etiam leo pede, rhoncus venenatis, tristique in, vulputate at,  odio. Donec et ipsum et sapien vehicula nonummy. Suspendisse potenti. Fusce  varius urna id quam. Sed neque mi, varius eget, tincidunt nec, suscipit id,  libero. In eget purus. Vestibulum ut nisl. Donec eu mi sed turpis feugiat  feugiat. Integer turpis arcu, pellentesque eget, cursus et, fermentum ut,  sapien. Fusce metus mi, eleifend sollicitudin, molestie id, varius et, nibh.  Donec nec libero.</p>
	<h2>H2 level heading </h2>
	<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Praesent aliquam,  justo convallis luctus rutrum, erat nulla fermentum diam, at nonummy quam  ante ac quam. Maecenas urna purus, fermentum id, molestie in, commodo  porttitor, felis. Nam blandit quam ut lacus. Quisque ornare risus quis  ligula. Phasellus tristique purus a augue condimentum adipiscing. Aenean  sagittis. Etiam leo pede, rhoncus venenatis, tristique in, vulputate at, odio.</p>
	<!-- end #mainContent --></div>
	<!-- This clearing element should immediately follow the #mainContent div in order to force the #container div to contain all child floats --><br class="clearfloat" />
  <div id="footer">
	<p>Footer</p>
  <!-- end #footer --></div>
<!-- end #container --></div>
</body>
</html>


Is This A Good Question/Topic? 0
  • +

Replies To: Redesigning Parent's business website

#2 stanimal123  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 20-February 09

Re: Redesigning Parent's business website

Posted 06 April 2009 - 04:14 PM

TRY the CSS propety : display:block;
and _display:block;
Was This Post Helpful? 0
  • +
  • -

#3 hullabaloo2  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 27-March 09

Re: Redesigning Parent's business website

Posted 07 April 2009 - 05:42 PM

View Poststanimal123, on 6 Apr, 2009 - 03:14 PM, said:

TRY the CSS propety : display:block;
and _display:block;

Thanks for the suggestion, but that didn't work. :/
Was This Post Helpful? 0
  • +
  • -

#4 gregwhitworth  Icon User is offline

  • Tired.
  • member icon

Reputation: 219
  • View blog
  • Posts: 1,604
  • Joined: 20-January 09

Re: Redesigning Parent's business website

Posted 08 April 2009 - 12:44 PM

2 real quick suggestions -

check to make sure that your <br/> isn't causing it. Also make sure that your <ul> is close to the ending <li>. I've pulled my hair out before when I didn't have an ending tag exactly where IE 6 wanted it.

--

Greg
Was This Post Helpful? 0
  • +
  • -

#5 forest51690  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 58
  • View blog
  • Posts: 340
  • Joined: 20-March 09

Re: Redesigning Parent's business website

Posted 08 April 2009 - 09:14 PM

try a negative padding property
Was This Post Helpful? 1
  • +
  • -

#6 hullabaloo2  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 27-March 09

Re: Redesigning Parent's business website

Posted 13 April 2009 - 04:47 AM

Negative margin took care of it. I still need to check with other IE versions, but I think that this will work. Thanks for all of the input guys! I'm really liking this forum.
Was This Post Helpful? 0
  • +
  • -

#7 level1  Icon User is offline

  • D.I.C Head

Reputation: 14
  • View blog
  • Posts: 65
  • Joined: 12-June 08

Re: Redesigning Parent's business website

Posted 13 April 2009 - 12:50 PM

I haven't examined the css or html on this post yet, but I'm familiar with this problem in IE. It comes down to line-height 99% of the time (for me anyway). I get some extra whitespace in IE below an image usually when it looks great in FF, or if I have a hair line rule (1 px tall) it is all funky in IE. Anyway, this is because IE inherits the line-height and font-size from its parents and it puts those attributes into your div or the parent of your img. Try adding:
line-height: 0px; font-size: 0px;
to your style and it should fix it. I prefer this over the negative padding hack, cuz I'm not sure how other browsers are going to handle that, but I know how they will handle font-size and line-height (although I've heard older safari may display incorrectly sometimes with one of them being 0, but have yet to see it). Hope this helps some one struggling w/ IE!
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1