Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

100% is not full width 1

Status
Not open for further replies.

hennep

Programmer
Dec 10, 2000
429
When I use this code in Internet explorer, the size of the image will be only 95% of the screen width.
In Firefox it works fine.
How can I make it work in IE as well?
Code:
<img src="[URL unfurl="true"]http://imkerforum.nl/image/menu/lijn.gif"[/URL] 
     border="0"
	 style="position: absolute; left: 0px; top: 50px; width: 100%; height: 1" >
 
What's with the absolute positiong. Besides, picture of 1 height could possibly be replaced by border or horizontal rule. The gap is probably the room for the scrollbar. Anyway, this should give the same result:
Code:
<div style="margin-top: 50px; border-top: 1px solid black;"></div>
and work in all browsers.
 
Of course I need to draw more than just a line. In the example I've shown there's only one image, just to keep it simple.
I want to draw a button bar above the page and the part I miss is more than the with of the scrollbar.
 
If you ask me, you constructed your question incorrectly. You said how to place a solid black line across the whole width. Assuming that is what you wanted, I provided you with a better code. Now put aside the solution you preconcieved in your head and tell us what you want to achieve. First thing, you will probably not need absolute positioning. Second, even if you will draw a rendition of Picasso there are still better ways to draw a line across the screen than what you're doing.
 
I have built a buttonbar. You can see it on this page: I am sure that there are better ways to get the same result but I would like to use the complete width of the page without redesigning the whole thing.
 
Try putting in a valid doctype.

AND

body { margin: 0px ; padding: 0px; }

Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
Hi Greg,

Did you mean this:
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<style type="text/css">
  body { margin: 0px ; padding: 0px; }
</style>

It is a big improvement, you've earned a star.
BUT it is still not full width, still missing a few pixels between the image and the scrollbar.
 
You're on the right track, but a complete doctype is similar to this:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[URL unfurl="true"]http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">[/URL]

Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top