hr
tag can be styled elegantly by using border: 0;
and then applying border-top: 1px solid #000;
. The 3D effect seen on the hr
is actually a default browser style, but it can be customized as suggested below.
hr {
border: 0;
border-top: 1px solid #000;
margin: 10px auto; /* For vertical spacing */
}
Check out the demo here
I recommend using <hr />
for semantic purposes, which adds meaning to your page and saves characters in the source code.
As for the span
tag, since it's an inline
element, you can make it span 100%
by changing its display property to block
.
span.separator {
border-top: 1px solid #000;
display: block;
margin: 10px auto; /* For vertical spacing */
}
For more information on styling inline span
tags, you can refer to my answer here.