Solved

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

Posted on 2004-04-17
3
351 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
  • 2
3 Comments
 
LVL 4

Expert Comment

by:john-at-7fff
Comment Utility
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
Comment Utility
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
Comment Utility
Thank you so much!
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
CSS is a visual language used to classify objects and define rules about how they should be displayed. CSS skills aren’t restricted to developers anymore, there is a big benefit to having a basic understanding of the language, regardless of your occ…
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
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 …

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now