Link to home
Start Free TrialLog in
Avatar of bobwood2000
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.dtd">
<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</h1>
  </span>
</body>
</html>
Avatar of john-at-7fff
john-at-7fff

bobwood2000 --

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.dtd">
<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</h1>
  </span>
</body>
</html>
ASKER CERTIFIED SOLUTION
Avatar of john-at-7fff
john-at-7fff

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of bobwood2000

ASKER

Thank you so much!