Solved

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

Posted on 2004-04-17
3
393 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Problem to refer to value 8 82
Change Firefox bookmarks menu font size 2 52
CSS Style 8 43
bootstrap wrap text 1 36
Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
In this Micro Tutorial viewers will learn how to create a CSS image sprite (In a later tutorial, viewers will learn how to use CSS and HTML to create a navigation menu using this sprite) Open a new Photoshop document with a width of (Icon width)x(N…

726 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