More IE alignment issues with CSS

Hello all,
I am new to the forum and also fairly new to CSS. I am having an issue with div aligments (I think the issue is with div alignment) only on IE. Look at the gap between the top banner and the body of the page. This is what I am talking about:

IE (with gap):

All other browsers with no gap (FF, Chrome, Safari and a few more from Linux):

I wish I could post a link to the site but it lives on my intranet.

The code is as follows:

Index page:


<?php
session_start();
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>TSRI's Ready To Ship</title>
<link href="css/thrColFixHdr.css" rel="stylesheet" type="text/css" />
<!--[if IE 5]>
<style type="text/css"> 
/* place css box model fixes for IE 5* in this conditional comment */
.thrColFixHdr #sidebar1 { width: 180px; }
.thrColFixHdr #sidebar2 { width: 190px; }
</style>
<![endif]-->
<!--[if IE]>
<style type="text/css"> 
/* place css fixes for all versions of IE in this conditional comment */
.thrColFixHdr #sidebar2, .thrColFixHdr #sidebar1 { padding-top: 30px; }
.thrColFixHdr #mainContent { zoom: 1; }
/* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */
</style>
<![endif]-->
</head>

<body class="thrColFixHdr">

<div id="container">
<?php
include 'includes/header.php';
include 'includes/leftSidebar.php';
?>

  <div id="sidebar2">
    <h3>Sidebar2 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 right 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. </p>
    <p>&nbsp;</p>
  <!-- end #sidebar2 --></div>
<?php
if(isset($_SESSION['piEmail']))
{
?>
  <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. </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" />
<?php
}
else
{
?>
  <div id="mainContent">
    <h1>You are not logged on</h1>
        <p>Click <a href="logon.php">HERE</a> to logon</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" />
<?php
}

include 'includes/footer.php';
?>
<!-- end #container --></div>
</body>
</html>


CSS file:

@charset 'utf-8';
body  
{
	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;
	background:#FFFFFF; /* non CSS browser */
	background: -webkit-gradient(linear, left top, left bottom, from(#69717B), to(#D3D3D3));/* webkit */
	/*background: -moz-linear-gradient(top,  777777,  CCCCCC); */
	background: -moz-linear-gradient(left 0deg, #69717B, #D3D3D3); /* firefox */
	filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#69717B', endColorstr='#D3D3D3');/* IE */
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 12px;
}

.thrColFixHdr #container 
{
	width: 1000px;  /* 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: 0px solid #000000;
	text-align: left; /* this overrides the text-align: center on the body element. */
} 

.thrColFixHdr #header 
{
	background-color: #FFFFFF;
	padding-top: 0;
	padding-right: 0px;
	padding-bottom: 0;
	padding-left: 0px;
} 

.thrColFixHdr #header h1 
{
	margin: 0; /* 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: 3; /* using padding instead of margin will allow you to keep the element away from the edges of the div */

	/* background-color: #DDDDDD; */
}
.thrColFixHdr #sidebar1 
{
	float: left; /* since this element is floated, a width must be given */
	width: 150px; /* the background color will be displayed for the length of the content in the column, but no further */
	padding: 5px 5px 5px 5px; /* padding keeps the content of the div away from the edges */
	background: #EBE6D3; /* non CSS browser */
	background: -webkit-gradient(linear, left top, left bottom, from(#EBE6D3), to(#FFFFFF));/* webkit */
	background: -moz-linear-gradient(top,  #EBE6D3,  #FFFFFF);/* firefox */
	filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#EBE6D3', endColorstr='#FFFFFF');/* IE */
	height: 550px;
	position: relative; 
	right: 0px; 
	top: -120px;
}

.thrColFixHdr #sidebar2 
{
	float: right; /* since this element is floated, a width must be given */
	width: 160px; /* the background color will be displayed for the length of the content in the column, but no further */
	padding: 5px 5px 5px 5px; /* padding keeps the content of the div away from the edges */
	background: #99CCFF; /* non CSS browser */
	background: -webkit-gradient(linear, left top, left bottom, from(#99CCFF), to(#FFFFFF));/* webkit */
	background: -moz-linear-gradient(top, #99CCFF, #FFFFFF);/* firefox */
	filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#99CCFF', endColorstr='#FFFFFF');/* IE */
	height: 550px;
	position: relative; 
	right: 0px; 
	top: -120px;
}

.thrColFixHdr #mainContent 
{
	margin: 0 200px; /* the right and left margins on this div element creates the two outer columns on the sides of the page. No matter how much content the sidebar divs contain, the column space will remain. You can remove this margin if you want the #mainContent div's text to fill the sidebar spaces when the content in each sidebar ends. */
	/* padding: 0 10px; */
	/* border: thin none #999; */
	position: relative; 
	right: 0px; 
	top: -120px;
} 

.thrColFixHdr #footer 
{ 
	padding: 0 10px 0 20px; /* this padding matches the left alignment of the elements in the divs that appear above it. */
	background: #d9ded8; /* non CSS browser */
	background: -webkit-gradient(linear, left top, left bottom, from(#d9ded8), to(#fefefe));/* webkit */
	background: -moz-linear-gradient(top,  #d9ded8,  #fefefe);/* firefox */
	filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#d9ded8', endColorstr='#fefefe');/* IE */
	position: relative; 
	right: 0px; 
	top: -120px;
}
 
.thrColFixHdr #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;
}

h1
{
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 16px;
	color: #336666;
	font-weight: bold;
}

h2 
{
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 14px;
	color: #CC6600;
	font-weight: bold;
}

h3 
{
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 12px;
	color: #666;
	font-weight: bold;
}

h4 
{
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 12px;
	color: red;
	font-weight: bold;
}

p 
{
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 12px;
	color: #4D4D4D;
}

table
{
	border-collapse:collapse;
	border: 0px solid #CCCCCC;
	background-color:#FFFFFF;
}

td
{
	vertical-align:middle;
	padding:1px;
	border-spacing:0px;
}

th
{
  	height: 20px;
  	font-weight: bold;
  	text-align: center;
  	background: #99CCFF;
	background: -webkit-gradient(linear, left top, left bottom, from(#99CCFF), to(#FFFFFF));/* webkit */
	background: -moz-linear-gradient(top,  #99CCFF,  #FFFFFF);/* firefox */
	filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#99CCFF', endColorstr='#FFFFFF');/* IE */
  
}

A:link 
{
	color:#0494BD;
}

A:visited 
{
	color:#0494BD;
}

A:active 
{
	color:#0494BD;
}

A:hover 
{
	color:#01CAF5;
}

ul
{
  	list-style-type: none;
}

#banner_img
{
	position: relative; 
	right: 0px; 
	top: -150px; 	
}

Left side nav bar:

<div id="sidebar1">
<?php
include 'includes/conn.php';
include 'includes/snrCountClass.php';

if(isset($_SESSION['piEmail']))
{
    echo "<p><strong>You are logged on as ".$_SESSION['piFirstName']." ".$_SESSION['piLastName']."</strong></p>";
?>
    <p><a href="Step1_shipmentType.php">Generate Shipment</a></p>
    <p><a href="reports.php">My Transactions</a></p>
<?php
}
else
{
    echo "<p>You are not logged on</p>";
}

if(!isset($_SESSION['usrType']))
{
?>
<p><a href="addNewAcc.php">New Account</a></p>
<p><a href="retrievepwd.php">New Password</a></p>
<?PHP
}
?>
<p><a href="retrievepwd.php">Reset Password</a></p>

<?PHP

if(isset($_SESSION['usrType']))
{
?>
    <p><strong>My Address Book</strong></p>
    <p>&nbsp;&nbsp&nbsp;&nbsp;&nbsp;<a href="addressBook.php">Select</a></p>
    <p>&nbsp;&nbsp&nbsp;&nbsp;&nbsp;<a href="addrNew.php">Add New</a></p>
    <p>&nbsp;&nbsp&nbsp;&nbsp;&nbsp;<a href="addrEdit.php">Edit</a></p>
    <p>&nbsp;&nbsp&nbsp;&nbsp;&nbsp;<a href="addrRemove.php">Remove</a></p>
<?PHP
	
    if(($_SESSION['usrType'] == "EHS") || ($_SESSION['usrType'] == "ADM"))
    {
?>
        <p><strong>EH&amp;S Approvals</strong>&nbsp;(<?PHP

	$ehsCount = new myCount();
	$thisCount = $ehsCount->myehsCount($_SESSION['campus']);
	echo $thisCount;

?>)</p>
	<p>&nbsp;&nbsp&nbsp;&nbsp;&nbsp;<a href="ehsApprovals.php?transType=BIO">Biological</a></p>
        <p>&nbsp;&nbsp&nbsp;&nbsp;&nbsp;<a href="ehsApprovals.php?transType=CHEM">Chemical</a></p>
	<p>&nbsp;&nbsp&nbsp;&nbsp;&nbsp;<a href="ehsApprovals.php?transType=RAD">Radiological</a></p>

<?PHP
    }
    else
    {
        //do nothing
    }
}

if(isset($_SESSION['usrType']))
{
    if(($_SESSION['usrType'] == "SNR") || ($_SESSION['usrType'] == "ADM"))
    {
?>
     	<p><strong>S&amp;R Main</strong>&nbsp;(<?PHP

	$snrCount = new myCount();
	$thisCount = $snrCount->mysnrCount($_SESSION['campus']);
	echo $thisCount;

?>)</p>
		<p>&nbsp;&nbsp&nbsp;&nbsp;&nbsp;<a href="snrGetTrack.php">Enter Tracking #'s</a></p>
		<p>&nbsp;&nbsp&nbsp;&nbsp;&nbsp;<a href="snrSearch.php">Search</a></p>
<?PHP
    }
    else
    {
        //do nothing
    }
}

if(isset($_SESSION['usrType']))
{
    if($_SESSION['usrType'] == "ADM")
    {
?>
     	<p><strong>Admin</strong></p>
		<p>&nbsp;&nbsp&nbsp;&nbsp;&nbsp;<a href="stats.php">Stats</a></p>
<?PHP
    }
    else
    {
        //do nothing
    }
}
if(isset($_SESSION['piEmail']))
{
?>
        <p><strong>Logoff</strong></p>
        <p>&nbsp;&nbsp&nbsp;&nbsp;&nbsp;<a href="logoff.php">Logoff</a></p>
<?PHP
}
else
{
?>
    <p><a href="logon.php">Logon</a></p>
<?PHP
}
?>
<!-- end #sidebar1 -->
</div>

Your help will be greatly appreciated.

FC

Hi fcarpio. Welcome to SitePoint. :slight_smile:

Two things, firstly: 1) what version of IE is this happening in (as there are 4 of them in common use, all with their differences) and 2) please post your code as it renders in the browser (that is, without all the PHP). CSS issues are purely to do with wat is seen in the browser, and PHP is removed before the page gets to the browser, so we need to see what the browser sees. :slight_smile:

Hi,

As Ralph said we need to see the html from view source rather than your include code.

At a guess I would think its a gap under an image and you either need to set the img to display:block or if the image needs to be inline the set its vertical alignment to top.

e.g.
#header img{display:block}

(or whatever your header is called).

I notice you have some weird rules in your css that are unlikely to be useful.

e.g.


[COLOR=#000000][COLOR=#FF8000] [/COLOR][COLOR=#0000BB]height[/COLOR][COLOR=#007700]: [/COLOR][COLOR=#0000BB]550px[/COLOR][COLOR=#007700]; 
    [/COLOR][COLOR=#0000BB]position[/COLOR][COLOR=#007700]: [/COLOR][COLOR=#0000BB]relative[/COLOR][COLOR=#007700];  
    [/COLOR][COLOR=#0000BB]right[/COLOR][COLOR=#007700]: [/COLOR][COLOR=#0000BB]0px[/COLOR][COLOR=#007700];  
    [/COLOR][COLOR=#0000BB]top[/COLOR][COLOR=#007700]: -[/COLOR][COLOR=#0000BB]120px[/COLOR][COLOR=#007700];
}
[/COLOR][/COLOR]

Usually you wouldn’t set a height on elements that hold fluid content and relative positioning isn’t meant for moving things around like that. It will leave a 150px hole in the page that will need to be accounted for. There is much likely a better way to do what you want but I’d need to see the proper source to debug.

Thanks for the replies and sorry for the newbie mistake. Currently I am using IE 9 but I know this also happens with IE 8.

The code as it is rendered by the browser is:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>TSRI's Ready To Ship</title>
<link href="css/thrColFixHdr.css" rel="stylesheet" type="text/css" />
<!--[if IE 5]>
<style type="text/css"> 
/* place css box model fixes for IE 5* in this conditional comment */
.thrColFixHdr #sidebar1 { width: 180px; }
.thrColFixHdr #sidebar2 { width: 190px; }
</style>
<![endif]-->
<!--[if IE]>
<style type="text/css"> 
/* place css fixes for all versions of IE in this conditional comment */
.thrColFixHdr #sidebar2, .thrColFixHdr #sidebar1 { padding-top: 30px; }
.thrColFixHdr #mainContent { zoom: 1; }
/* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */
</style>
<![endif]-->
</head>

<body class="thrColFixHdr">

<div id="container">
<div id="header">
<img src="images/banner3.png" width="1000" height="150" alt="Ready To Ship!" />	
</div>
<div id="banner_img">
<img src="images/TSRI_Logo_Clear_RTS.png" width="761" height="120" />
</div>
<!-- end #header -->
<div id="sidebar1">
<p>You are not logged on</p><p><a href="addNewAcc.php">New Account</a></p>
<p><a href="retrievepwd.php">New Password</a></p>
<p><a href="retrievepwd.php">Reset Password</a></p>

    <p><a href="logon.php">Logon</a></p>
<!-- end #sidebar1 -->
</div>
  <div id="sidebar2">
    <h3>Sidebar2 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 right 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. </p>
    <p>&nbsp;</p>
  <!-- end #sidebar2 --></div>
  <div id="mainContent">
    <h1>You are not logged on</h1>
        <p>Click <a href="logon.php">HERE</a> to logon</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 message goes here</p>
<!-- end #footer --></div>
<!-- end #container --></div>
</body>
</html>


Hi Paul,
I tried this and the gap got smaller, but did not completely go away. I think we (well, you) are getting closer.

FC

First thing to do is to use a proper doctype. The one that you are using below is a very old doctype and will make all versions of IE render as though they are more like ie5 than anything built this century.


[COLOR=#000000][COLOR=#007700]<![/COLOR][COLOR=#0000BB]DOCTYPE HTML [/COLOR][COLOR=#007700]PUBLIC [/COLOR][COLOR=#DD0000]"-//W3C//DTD HTML 4.01 Transitional//EN"[/COLOR][COLOR=#007700]> [/COLOR][/COLOR]

You should use :


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

But really should be aiming for strict these days.


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">


It looks like you haven’t removed the whitespace between the header tags either which is probably causing your remaining gap.


#header img,#banner_img img{display:block}


<body class="thrColFixHdr">
<div id="container">
    <div id="header"><img src="http://www.sitepoint.com/forums/images/banner3.png" width="1000" height="150" alt="Ready To Ship!" /></div>
    <div id="banner_img"><img src="http://www.sitepoint.com/forums/images/TSRI_Logo_Clear_RTS.png" width="761" height="120" alt="" /></div>
    <!-- end #header -->

There should be no white space in the html between the opening and closing tags and the image inside.

I’m not sure what you were attempting as you seem to have dragged #banner_img on top of the header. If that was your idea then use negative margins instead to protect the flow of the document and then you won’t need to adjust everything else.


#banner_img {
    position: relative;
[B]    margin-top:-120px;
    top:-30px;[/B]
}

Then you can remove all these:


/*height: 550px;
    position: relative;
    right: 0px;
    top: -120px; */

As I said you can’t use height on your columns as that is an accident waiting to happen. Containers that hold fluid content should have their height dictated by their content and not some arbitrary measurement that you think looks nice :slight_smile:

I’m guessing that the code should look like this:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>TSRI's Ready To Ship</title>
<link href="css/thrColFixHdr.css" rel="stylesheet" type="text/css" />
<style type="text/css">
@charset 'utf-8';
.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: 0;
}
h1 {
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 16px;
    color: #336666;
    font-weight: bold;
}
h2 {
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 14px;
    color: #CC6600;
    font-weight: bold;
}
h3 {
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 12px;
    color: #666;
    font-weight: bold;
}
h4 {
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 12px;
    color: red;
    font-weight: bold;
}
p {
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 12px;
    color: #4D4D4D;
}
table {
    border-collapse:collapse;
    border: 0px solid #CCCCCC;
    background-color:#FFFFFF;
}
td {
    vertical-align:middle;
    padding:1px;
    border-spacing:0px;
}
th {
    height: 20px;
    font-weight: bold;
    text-align: center;
    background: #99CCFF;
    background: -webkit-gradient(linear, left top, left bottom, from(#99CCFF), to(#FFFFFF));/* webkit */
    background: -moz-linear-gradient(top, #99CCFF, #FFFFFF);/* firefox */
 filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#99CCFF', endColorstr='#FFFFFF');/* IE */
}
a, a:visited {
    color:#0494BD;
}
a:hover {
    color:#01CAF5;
}
ul {
    list-style-type: none;
}
body {
    margin: 0;
    padding: 0;
    text-align: center;
    color: #000000;
    background:#FFFFFF;
    background: -webkit-gradient(linear, left top, left bottom, from(#69717B), to(#D3D3D3));/* webkit */
    /*background: -moz-linear-gradient(top,  777777,  CCCCCC); */
    background: -moz-linear-gradient(left 0deg, #69717B, #D3D3D3); /* firefox */
 filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#69717B', endColorstr='#D3D3D3');/* IE */
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 12px;
}
.thrColFixHdr #container {
    width: 1000px;
    background: #FFFFFF;
    margin: 0 auto;
    text-align: left;
.thrColFixHdr #header {
 background-color: #FFFFFF;
 padding:0
}
.thrColFixHdr #header h1 {
    margin: 0;
    padding: 3px;
}
.thrColFixHdr #sidebar1 {
    float: left;
    width: 150px;
    padding: 5px 5px 5px 5px;
    background: #EBE6D3;
    background: -webkit-gradient(linear, left top, left bottom, from(#EBE6D3), to(#FFFFFF));/* webkit */
    background: -moz-linear-gradient(top, #EBE6D3, #FFFFFF);/* firefox */
 filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#EBE6D3', endColorstr='#FFFFFF');/* IE */
    min-height:550px;
}
.thrColFixHdr #sidebar2 {
    float: right;
    width: 160px;
    padding: 5px 5px 5px 5px;
    background: #99CCFF; /* non CSS browser */
    background: -webkit-gradient(linear, left top, left bottom, from(#99CCFF), to(#FFFFFF));/* webkit */
    background: -moz-linear-gradient(top, #99CCFF, #FFFFFF);/* firefox */
 filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#99CCFF', endColorstr='#FFFFFF');/* IE */
    min-height:550px;
}
.thrColFixHdr #mainContent {
    margin: 0 200px;
}
.thrColFixHdr #footer {
    padding: 0 10px 0 20px;
    background: #d9ded8; /* non CSS browser */
    background: -webkit-gradient(linear, left top, left bottom, from(#d9ded8), to(#fefefe));/* webkit */
    background: -moz-linear-gradient(top, #d9ded8, #fefefe);/* firefox */
 filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#d9ded8', endColorstr='#fefefe');/* IE */
}
.thrColFixHdr #footer p {
    margin: 0;
    padding: 10px 0;
}
#banner_img {
    position: relative;
    margin-top:-120px;
    top:-30px;
}
#header img, #banner_img img {
    display:block
}
</style>
<!--[if IE 5]>
<style type="text/css"> 
/* place css box model fixes for IE 5* in this conditional comment */
.thrColFixHdr #sidebar1 { width: 180px; }
.thrColFixHdr #sidebar2 { width: 190px; }
</style>
<![endif]-->
<!--[if IE]>
<style type="text/css"> 
/* place css fixes for all versions of IE in this conditional comment */
.thrColFixHdr #mainContent { zoom: 1; }
/* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */
</style>

<![endif]-->
</head>
<body class="thrColFixHdr">
<div id="container">
    <div id="header"><img src="http://www.sitepoint.com/forums/images/banner3.png" width="1000" height="150" alt="Ready To Ship!" /></div>
    <div id="banner_img"><img src="http://www.sitepoint.com/forums/images/TSRI_Logo_Clear_RTS.png" width="761" height="120" alt="" /></div>
    <div id="sidebar1">
        <p>You are not logged on</p>
        <p><a href="addNewAcc.php">New Account</a></p>
        <p><a href="retrievepwd.php">New Password</a></p>
        <p><a href="retrievepwd.php">Reset Password</a></p>
        <p><a href="logon.php">Logon</a></p>
    </div>
    <div id="sidebar2">
        <h3>Sidebar2 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 right 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. </p>
    </div>
    <div id="mainContent">
        <h1>You are not logged on</h1>
        <p>Click <a href="logon.php">HERE</a> to logon</p>
    </div>
    <br class="clearfloat" />
    <div id="footer">
        <p>Footer message goes here</p>
    </div>
</div>
</body>
</html>



You could apply a background image to the image itself and that would allow you to change the background behind the image at will. Assuming that’s what you meant.:wink:

Awesome Paul! The following did the trick:

#header img,#banner_img img{display:block}

I am going to take your advise on the rest of the suggestions.

THANKS A MILLION!!!

Removing this:

/*height: 550px;
    position: relative;
    right: 0px;
    top: -120px; */

Causes this:

But did you change the corresponding banner image as directed.


#banner_img {     position: relative; [B]    margin-top:-120px;     top:-30px;[/B] }

Check out the full code in my previous post as all the fixes were rolled into that. Although of course, I am guessing at a lot of things as I have no idea why you would be pulling one image on top of another:) It’s hard to debug properly without a working example to play with and to see what’s its supposed to look like.

Thanks. The idea of the overlaying image was to leave the company logo and change the background very easily, the top image has a clear background. I guess I can make it a single image and be done with it. :slight_smile:

I did look at your code very carefully but I think I will leave this for tonight as I rather do this during quiet time, too crazy right now.

Thanks again for taking the time to reply to my post.

OK, I couldn’t help it and I had to try it. It works!

Thank you Paul.

FC

A minor quibble, but with an HTML 4 doctype, those closing slashes ( [COLOR="Red"]/[/COLOR]> ) on meta tags and images etc. aren’t needed.