Previous Message
Next Message

Re: [css-d] Styling <HR>s

Sent by Tuttle Grey on 13 May 2002 22:10


>From: "Timothy Martens" [EMAIL-REMOVED]>
>To: [EMAIL-REMOVED]>
>Subject: [css-d] Styling <HR>s
>Date: Mon, 13 May 2002 14:12:56 -1000
>
>Has anyone come up with a method to consistently style Horizontal rules?
>All the browsers seem to render differently. I'm just trying to create a
>simple <hr> that's say 5px in height without shading. It's proven to be
>more difficult than I would have expected!

Yes, I did a lot of experimenting on this. My code is below; you'll think 
some of it is redundant, and it is, but the redundancies are required in 
order to get it to display in all major browsers.

HR {color: red; background: red; border: 0; height: 5px; width: 80%; }

Internet Explorer uses the color property, which is incorrect. The color 
property correctly applies to the foreground text color, not the background 
color.

Mozilla (Netscape) and Opera use the background-color property. In browsers 
like Opera and Mozilla, you would still have the border of your HR showing, 
which you may not want. To get rid of that border, set the border to zero.  
Remember that an HR leaves some default space below it.

_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com
Previous Message
Next Message

Message thread:

Possibly related: