I have a ul with tree list items in an horizontal view.
All the list items have the same background image:

I want to overlap the background images so it looks like this:

Here is my jsFiddle
CSS:
div#menu ul li{
height:30px;
display: inline;
list-style-type: none;
width: 60px;
background: url(https://i.stack.imgur.com/adwVj.jpg);
background-size: 100%;
background-repeat: no-repeat;
padding-right: 5px;
padding-left:30px;
z-index:2;
}
div#menu ul li:first-child{
padding-left:20px;
z-index:3;
}
div#menu ul li:last-child{
padding-left:35px;
margin-left:-30px
z-index:1;
}
HTML:
<div id="menu">
<ul>
<li>Account</li>
<li>Registreren</li>
<li>Winkelwagen</li>
</ul>
</div>
It goes wrong with the z-index!
you should first give at least
position: relativeto your list-items, otherwisez-indexhas no effect. then just useso the labels will remain close together (this rule will be applied starting from the second
<li>element)Example fiddle : http://jsfiddle.net/Faffz/3/