Code Snippet
Cross-Browser hr Styling
For regular browsers
hr {
border : 0;
height : 15px;
background : url(hr.gif) 50% 0 no-repeat;
margin : 1em 0;
}
For IE < 8 (use conditional stylesheets)
hr {
display : list-item;
list-style : url(hr.gif) inside;
filter : alpha(opacity=0);
width : 0;
}
Here’s a way to get cross-browser hr tags with some progressive-enhancement niceties. Note the use of page-break-after for printing purposes, as well as the line-height and margin to position the :after content (which are section symbols).
you set both the color and background-color since different browsers render hrs differently. The goal here is to make the line look like a line of the color you intended, not necessarily to make it look exactly the same in all browsers.
This and other neat CSS snippets can be found at Hawidu CSS.
Pretty neat, i always have trouble styling them cross browser… i will give this code a try !!
new styles: http://css-tricks.com/15135-simple-styles-for-horizontal-rules/ ;)
DigWP
A book and blog co-authored by Jeff Starr and myself about the World's most popular publishing platform.
Quotes on Design
Design, like Art, can be an elusive word to define and an awfully fun thing to have opinions about.
HTML-Ipsum
One-click copy to clipboard access to Lorem Ipsum text that comes wrapped in a variety of HTML.
Bookshelf
Hey Chris, what books do you recommend? These, young fertile mind, these.