467,910 Members | 1,795 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,910 developers. It's quick & easy.

hr and space in IE

Hello.

I have this code of CSS:

hr.line1gray{
height:1px;
border:none;
background:gray;
padding:0;
margin:0;
}

Everywhere looks good, but IE adding some space before and below 1px line.
Why ?

Cezar.
Jul 20 '05 #1
  • viewed: 7041
Share:
3 Replies
"Cezar" <ce*****@imail.net.pl> wrote:
I have this code of CSS:

hr.line1gray{
height:1px;
border:none;
background:gray;
padding:0;
margin:0;
}

Everywhere looks good, but IE adding some space before and below 1px line.
Why ?


IE quirk.

--
Spartanicus
Jul 20 '05 #2
Spartanicus wrote:
"Cezar" <ce*****@imail.net.pl> wrote:

I have this code of CSS:

hr.line1gray{
height:1px;
border:none;
background:gray;
padding:0;
margin:0;
}

Everywhere looks good, but IE adding some space before and below 1px line.
Why ?

IE quirk.

Sometimes you can eliminate this by giving margin a small negative
value. margin: -2px 0 -2px 0; If no improvement, try slightly larger
numbers.
H
Jul 20 '05 #3
> >>Everywhere looks good, but IE adding some space before and below 1px
line.
Why ?

IE quirk.

Sometimes you can eliminate this by giving margin a small negative
value. margin: -2px 0 -2px 0; If no improvement, try slightly larger
numbers.
H


I changed to:

div.line1gray {
width: 100%;
height: 1px;
margin: 0px;
border-top: 1px solid gray;
padding: 0px;
display: block;
font-size: 1px;
}

Works fine on IE, Mozilla, Opera. Any other I don't know, but could be good.

Greets,
Cezar.
Jul 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Malcolm Dew-Jones | last post: by
38 posts views Thread by Xah Lee | last post: by
11 posts views Thread by kenneth | last post: by
10 posts views Thread by Bing Wu | last post: by
5 posts views Thread by Yasaswi Pulavarti | last post: by
2 posts views Thread by shagy | last post: by
10 posts views Thread by Phil Stanton | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.