Using the technique from this post, I have a nice justified menu bar.
However, I would like to add dividers between the entries which appear on mouse hover.
My first attempt turned out quite terrible:
<div id="menu">
<ul>
<li>
Item
</li>
<li>
Menu
</li>
<li>
Link
</li>
<li>
Asdf
</li>
</ul>
<span></span>
</div>
#menu {
text-align: justify;
background-color:gray;
padding:5px;
}
#menu * {
display: inline;
}
#menu li {
display: inline-block;
color:white;
}
#menu ul {
padding-left:0px;
margin:0px 100px;
}
#menu span {
display: inline-block;
position: relative;
width: 100%;
height: 0;
}
#menu li:hover {
color:blue;
border-left:1px solid black;
border-right:1px solid black;
}
The problem with the above is that the borders are not centered between the menu entries.
This is certainly doable with javscript, but I would like to know if it's possible with pure CSS.
` elements
– Zach Lysobey Jan 08 '14 at 20:30