Forum Moderators: not2easy
<div class="navbox" style="width:100%; margin:0px; padding:0px; position:absolute; top:160px; left:0px;">
<table>
<tr>
<td>
<span class="home2"><a href="#"></a></span>
</td>
</tr>
</table>
</div>
Thanks in advance for your help.
**NOTE** I didn't post my full nav code with all the links to save space, but that is all there is in it.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
body element (as suggested by Marshall above) fixes the problem when using the limited test case you mention. So the problem will probably lie elsewhere. What other CSS rules apply to this section? Does your markup and CSS validate?
HTML validator [validator.w3.org]
CSS validator [jigsaw.w3.org]
Marshall
I already have that in my CSS. That was the original fix I was referring to when I said it was working fine before I uploaded it onto the web. (refering to IE)
Does it work OK in FF, locally and when uploaded?
Are you using a separate stylesheet? Assuming the files have uploaded OK, it is possible the old stylesheet is stuck in IE's browser cache, so you are not seeing the updated styles. Clear your cache and hit Ctrl+F5.
Irrespective of the doctype, in this instance specifying a zero margin and padding for the body element (as suggested by Marshall above) fixes the problem when using the limited test case you mention.
So the problem will probably lie elsewhere. What other CSS rules apply to this section? Does your markup and CSS validate?
Strict dtd is not really meant to be used with tables. You may want to read this thread.
Does it work OK in FF, locally and when uploaded?Are you using a separate stylesheet? Assuming the files have uploaded OK, it is possible the old stylesheet is stuck in IE's browser cache, so you are not seeing the updated styles. Clear your cache and hit Ctrl+F5.
Marshall
CSS
#top_nav_bar {
width: 900px;
height: 50px;
margin: 5px 0;
padding: 0;
font-size: 15px;
line-height: 50px;
color: #FFF;
text-align: center;
background-color: #FFF;
}
ul#top_nav {
width: 900px;
margin: 0;
padding: 0;
list-style-type: none;
}
ul#top_nav li {
font-size: 15px;
line-height: 50px;
text-align: center;
display: block;
float: left;
}
ul#top_nav li a, ul#top_nav li a:visited {
width: 149px;
height: 50px;
margin-left: 1px;
color: #FFF;
text-decoration: none;
background-color: #EC0034;
display: block;
}
ul#top_nav li a:hover {
color: #FFF;
background-color: #F8B208;
}
HTML
<div id="top_nav_bar"><ul id="top_nav"><li><a href="">LINK</a></li><li><a href="">LINK</a></li><li><a href="">LINK</a></li><li><a href="">LINK</a></li><li><a href="">LINK</a></li><li><a href="">LINK</a></li></ul></div>
Give your div an id to reference it (I've used 'o' in this snippet), add the following in your 'body' tag:
onload="document.getElementById('o').style.width=document.body.clientWidth"
onresize="document.getElementById('o').style.width=document.body.clientWidth"
Tested in IE7, FF, Opera, and should be IE4 compatible.