There are two main questions here.
1) First, do you apply positioning to elements that really don't make sense? Example: when you set the position: absolute; vertical-align: top; will do nothing, since it applies only to inline elements.
Secondly, you didnβt think much about the problem, and it seems like you stick to the code where you can.
So, take a step back and think about what each element does, and lay out the steps to achieve it. We start with a black box and end with a box with chevrons.
1) I create a container with a fixed height, and then set it to overflow: hidden; thus, nothing at a certain height will be shown.
2) I set the position of the elements much differently than you. Elements of my list move to the left.
3) Then place the margins and indents in the list item space.
4) Finally, I put in chevrons and style them.
Here is an example of what I did ...
ul.chevronbar {list-style-type: none; margin: 0; padding: 0; height:50px; width:auto; overflow:hidden;} ul.chevronbar li {margin: 0; padding: 0; height:50px; width:auto; border:1px solid #000; position:relative; float:left; background:#333; font-size: 1.5em; margin-right: 1em; padding: 0 0.7em; } ul.chevronbar li a {text-decoration: none; color: #fff; line-height:50px; display:block;} ul.chevronbar li:before, ul.chevronbar li:after {content: ' '; height: 0; width: 0; position: absolute; top:-2px; border: 1.2em solid transparent; border-left-width: 0.45em; border-right-width: 0.45em;} ul.chevronbar li:before {border-top-color: #333; border-bottom-color: #333; border-right-color: #333; right: 100%;} ul.chevronbar li:after {border-left-color: #333; left: 100%; margin-left: -0.01em;} li.first {padding-left: 0.5em;} li.first:before {border: none !important ;} li.last:after {border: none !important;}
source share