http://jsbin.com/hefavo/1/edit
Hey I stumbled upon this question trying to do something similar. Check out my solution. It isn't perfect because you can't change the angle of the arrow (border widths can't be a percentage) which means the arrow will always stick out a certain distance.
For example, if you try a three-line-height thing it will look weird. However, to adjust for that, you can simply set the "margin-left" on the before and after pseudo elements to 15px.
How it works:
Each li element has a before pseudo element which is the lower half of the arrow as a css triangle that extends to 500 x 1000. The after pseudo element is the top half. The triangles are then positioned to the right side (not exactly... see below) of the menu item, with the margin-left setting controlling how much it sticks out.
.filters .selected:before {
position:absolute;
height: 0;
top: 50%;
// transform:scaleY(-1);
max-width: 300%;
border-right: 500px solid #3aa5de;
border-bottom: 1000px solid transparent;
content: "";
left: 50%;
border-radius:0;
margin-left: 10px;
transform: scaleX(-1) translateX(100%);
}
.filters .selected:after {
position:absolute;
height: 0;
top: 50%;
transform:scaleY(-1) scaleX(-1) translateY(100%) translateX(100%);
max-width: 300%;
border-radius:0;
border-right: 500px solid #3aa5de;
border-bottom: 1000px solid transparent;
content: "";
left: 50%;
margin-left: 10px;
}
The li element itself is used to mask off the parts of the triangles we don't need. Since the triangles stick out past the previous "100%", I set the li element width to 200%, set the pseudo element positions at 50%, and set the a element (the menu item) to 50% width.
.filters li{
overflow:hidden;
width: 200%;
position:relative;
}
.filters li a{
width:50%;
position:relative;
z-index: 1;
}
edit: Added in relevant bits of css
16is the default font size in most browser. If you, for example, setfont-size: 20pxon yourbody- you'll have to change your jQuery to20as well