Click to See Complete Forum and Search --> : Horizontal Rule Height


Dysan
01-02-2008, 06:45 PM
How do I get a horizontal rule (<hr>) to display at 1px in height?

Horizon88
01-02-2008, 06:50 PM
<hr style="height: 1px;" />

Should work.

NogDog
01-02-2008, 08:29 PM
If you just want a 1px line, you might find it easier to use CSS to style the border-bottom or border-top of one of the HTML elements that you are separating (using padding and margin values to get the desired spacing). If you really want to use a HR element:

<style type="text/css">
hr {
height: 1px;
background-color: #000000;
color: #000000;
border: none;
width: 90%;
margin: 1em auto;
}
</style>

This should give you a consistent result on all browsers. (Adjust values as desired for the spacing/width you want.)