Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 20th, 2005, 11:46 PM
Cezar
Guest
 
Posts: n/a
Default 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.


  #2  
Old July 20th, 2005, 11:46 PM
Spartanicus
Guest
 
Posts: n/a
Default Re: hr and space in IE

"Cezar" <cezaryk@imail.net.pl> wrote:
[color=blue]
>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 ?[/color]

IE quirk.

--
Spartanicus
  #3  
Old July 20th, 2005, 11:46 PM
Helen C
Guest
 
Posts: n/a
Default Re: hr and space in IE

Spartanicus wrote:[color=blue]
> "Cezar" <cezaryk@imail.net.pl> wrote:
>
>[color=green]
>>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 ?[/color]
>
>
> IE quirk.
>[/color]


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
  #4  
Old July 20th, 2005, 11:49 PM
Cezar
Guest
 
Posts: n/a
Default Re: hr and space in IE

> >>Everywhere looks good, but IE adding some space before and below 1px
line.[color=blue][color=green][color=darkred]
> >>Why ?[/color]
> >
> >
> > IE quirk.
> >[/color]
>
>
> 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[/color]

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.


 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles