After multiple attempts and reviewing some solutions, I'm still struggling to align the text properly within the parent div and extend the white separators to match the full length of the parent.
https://jsfiddle.net/oxgg6qrf/ <-- This is the code I've been working on, but I can't figure out why the separator divs are not extending correctly.
Here's the code snippet:
<div id="ambMenu">
<ul id="ulMenu">
<li id="liMenuBar1"><div class="ambMenuDivider"></div></li>
<li id="liMenuOption1">Test1</li>
<li id="liMenuBar2"><div class="ambMenuDivider"></div></li>
<li id="liMenuOption2">Test2</li>
<li id="liMenuBar3"><div class="ambMenuDivider"></div></li>
<li id="liMenuOption3">Test3</li>
<li id="liMenuBar4"><div class="ambMenuDivider"></div></li>
</ul>
</div>
#ambMenu { width: 360px; height: 25px; background-color: #333; color: #f2f2f2; }
#ulMenu { list-style-type: none; margin: 0; padding: 0; display: inline-block; }
#liMenuBar1 { padding-left: 30px; float: left; display: inline-block; margin: 0; }
#liMenuBar2, #liMenuBar3, #liMenuBar4 { float: left; display: inline-block; margin: 0; padding-left: 10px; padding-right: 5px; }
#liMenuOption1, #liMenuOption2, #liMenuOption3 { float: left; display: inline-block; margin: 0; vertical-align: middle; }
.ambMenuDivider { border-left:5px solid #f2f2f2; display: inline; padding-left: 5px; padding-right: 5px;}
Although there are many ids in the code, they are necessary for a future JavaScript script.
Is there a more efficient way to create a menu like this with consistent alignment? What am I overlooking?