I'm trying to create separators using CSS, for keeping it semantic, and removing styles from content.
However, I wanted to have a border bottom below each <li>
item. The :before
selector however, extends the width of the <li>
element, and it is creating an inconsistent border.
I've tried answers from Separators For Navigation, which uses a similar approach as mine, and gives the same problems.
This is my navigation (tab-based) below
<nav class="innerNav">
<ul>
<li>One </li>
<li>Two</li>
<li>Three</li>
<li>Four</li>
</ul>
</nav>
and my CSS
.innerNav li {
display: inline-block;
border-bottom: 3px solid red;
}
.innerNav li:before {
content: "|";
display: inline-block;
color: blue;
border: 0;
padding-right: 10px;
}
.innerNav li:first-child:before {
display: none;
}
Here is a fiddle : http://jsfiddle.net/XFd6D/