bobwood2000
asked on
span width is 100%...yet IE6 leaves space on the right
I was expecting the code below to display a navy bar across the top of the browser window. However, in IE6 (though not Mozilla) about 5px of space is left between the right of the bar and the edge of the browser. I would very much appreciate any help.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.d td">
<html>
<head>
<title>Welcome</title>
<style type="text/css">
span.LogoBar {position:absolute;
top:0%; height:6em; width:100%; right:0%; left:0%;
text-align:center; background-color:navy;
border:2px solid black;}
</style>
</head>
<body>
<span class="LogoBar">
<h1 class="LogoBar">Welcome</h 1>
</span>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.d
<html>
<head>
<title>Welcome</title>
<style type="text/css">
span.LogoBar {position:absolute;
top:0%; height:6em; width:100%; right:0%; left:0%;
text-align:center; background-color:navy;
border:2px solid black;}
</style>
</head>
<body>
<span class="LogoBar">
<h1 class="LogoBar">Welcome</h
</span>
</body>
</html>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you so much!
What's going on is that your span is still within the body. You need to reduce the body padding. Here's a way to get a bit further with regular HTML ( ** Look at the body tag ** ) -- in a sec I'll see if there's a good css way to get want you want.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.d
<html>
<head>
<title>Welcome</title>
<style type="text/css">
span.LogoBar {position:absolute;
top:0%; height:6em; width:100%; right:0%; left:0%;
text-align:center; background-color:navy;
border:2px solid black;}
</style>
</head>
<body marginwidth="0" rightmargin="0">
<span class="LogoBar">
<h1 class="LogoBar">Welcome</h
</span>
</body>
</html>