Forum Moderators: not2easy

Message Too Old, No Replies

IE & divs

It was supposed to be so simple, sigh...

         

edit_g

5:38 am on May 9, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I wanted a solid line with no spacing right at the top of the page, and using the code below, that's exactly what I get (in Firefox). When I check it on IE, it moves to wherever it wants (slightly down the page, and with whitespace on the right).

div#top{position: absolute; width:100%;top:0;left:0;right:0;border-bottom: 10px solid #BCB242;padding:0;margin:0;}

HTML - <div="top"></div>

Any ideas?

Krapulator

6:26 am on May 9, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Add a line-height:0; to your div and add margin:0; to your body:


body{
margin: 0;
}

div#top{
position: absolute;
width:100%;
top:0;
left:0;
right:0;
border-bottom: 10px solid #BCB242;
padding:0;
margin:0;
line-height:0;
}

edit_g

6:39 am on May 9, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks, Krapulator, that works a treat! :)