h1

CSS settings for horizontal rule (hr)

September 21, 2008

I was having some difficulty with the different ways that IE7 and Firefox rendered any CSS I’d set for the horizontal rule (hr) tag. Here’s my solution (substitute your own color and sizing values):

hr
{
height: 1px;
color: #808000; /* only works in IE */
background-color: #808000; /* needed to color the HR in Firefox */
border: 0px; /* needed for Firefox so that it renders the 1px height correctly */
}

One comment

  1. Thanks for sharing this very useful code snippet. I’ve had the same problem but never knew (till today) the solution to it :-)



Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 298 other followers

%d bloggers like this: