Log in

View Full Version : Header offset in IE - fine in FF



Woody
02-01-2008, 10:12 PM
Hi, I have read quite a few posts and tried quite a few things but can't come up with a solution. The header is fine in FF but off set in IE. I'm improving with my CSS skills, but I'm stumped on this - can anyone help.

The site is:

http://www.lbconline.co.uk

and the CSS is

/* header */
#header {
height: 175px;
text-align: left;
margin-right: auto;
margin-left: auto;
padding: 0px;
margin-top: 15px;
margin-bottom: 0px;
border-top-width: 0px;
border-right-width: 0px;
border-left-width: 0px;
border-top-style: none;
border-right-style: solid;
border-left-style: solid;
border-top-color: #FF6600;
border-right-color: #FF6600;
border-left-color: #FF6600;
border-bottom-width: 0px;
border-bottom-color: #FF6600;
}
#header-content {
position: relative;
padding: 0;
float: left;
margin-top: 0;
margin-right: auto;
margin-bottom: 0;
margin-left:auto;
height: 175px;
border-top-width: thin;
border-right-width: thin;
border-bottom-width: 0px;
border-left-width: thin;
border-top-style: solid;
border-right-style: solid;
border-bottom-style: none;
border-left-style: solid;
border-top-color: #FF6600;
border-right-color: #FF6600;
border-left-color: #FF6600;
width: 950px;

All advice gratefully received!

Medyman
02-02-2008, 02:41 AM
Whoa! You're trying too hard... ;)

Try this:


#header {
height:175px;
width:950px;
margin:15px auto 0 auto; /* top,right,bottom,left */
padding:0;
border:thin solid #FF6600; /* Sets border all around */
border-bottom:none; /* Remoes bottom border */
}

You can get rid of the header_content div. In the header CSS you're defining things that you don't need to.

Divs don't have borders by default so if you don't want one, you don't need to define it's style and color only to set it's width to 0.

You had a few stray declerations which could have been throughing your header off -- a relative position style without setting any offset and a float to the left.

Woody
02-02-2008, 08:28 AM
Medyman - thank you so much - that has sorted the problem!

There is so much to learn and so little time to learn it - but I'm getting there - thanks for your help.