Solved

span width is 100%...yet IE6 leaves space on the right

Posted on 2004-04-17
3
407 Views
Last Modified: 2011-09-20
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>
0
Comment
Question by:bobwood2000
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 4

Expert Comment

by:john-at-7fff
ID: 10851769
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>
0
 
LVL 4

Accepted Solution

by:
john-at-7fff earned 350 total points
ID: 10851770
bobwood2000 --

Yeah, this is the way to get it all the way out (note style tag on body):

<!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 style="margin: 0">
  <span class="LogoBar">
      <h1 class="LogoBar">Welcome</h1>
  </span>
</body>
</html>
0
 

Author Comment

by:bobwood2000
ID: 10851985
Thank you so much!
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction A frequently asked question goes something like this:  "I am running a long process in the background and I want to alert my client when the process finishes.  How can I send a message to the browser?"  Unfortunately, the short answer…
So you have coded your own WordPress plugin and now you want to allow users to upload images to a folder in the plugin folder rather than the default media location? Follow along and this article will show you how to do just that!
In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

695 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question