It’s never good practice to use HTML elements as presentation elements, but sometimes you gotta use an <hr />.
color: #000; background-color: #000; height: 4px; border: none;
Note that you have to specify the color and background color so it works in IE.

5 Comments
I don’t use hr’s at all. Haven’t for years. I just use a border and bump up the margin or padding, or in rare cases, an empty div with a border.
Ah thanks, I was wondering why my HRs weren’t working right in IE on PB.
I’m with Todd, I haven’t used hr tags in a long time, but this is good to know in case I do ever need it.
Any chance of some new tips being posted soon?
well what about mozilla. how will it look i mozilla?
The problem here is if you want a 1px high hr. It will not work in all browsers, no matter what you do.
And you should probably use hr-s where you want to separate sections with it. hr-s are not meant for presentation only, they also show up as separators for blind people or people with other visual accessibility problems.
3 Trackbacks
[…] : cssforlunch.com Difficulty : […]
[…] Source : cssforlunch.com […]
irhfyjhx…
irhfyjhx…