Online Snippets Library

Create cross browser hr styling in CSS

To create cross browser HR (horizontal rule) in CSS.We use following set of code. IE background images is the shaded border (left and top) that will not go away.

Example

<style type="text/css">
hr {
    border:0;
    background:url(/images/hr.gif) repeat-x;
    height:12px;
}
</style>
<!-- For IE < 8 (use conditional stylesheets)-->

<!--[if IE]>
<style>
hr {
    border:3px dotted #F0F;
    color:#F0F;
    background:#F0F;
    height:1px;
}
</style>
<![endif]-->