By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,493 Members | 1,936 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,493 IT Pros & Developers. It's quick & easy.

hr and space in IE

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
"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

P: n/a
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

P: n/a
> >>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.