The design that you are looking for is similar to the one described in this answer of mine. I am posting a separate answer because what you need is a bit more complex than that one due to the presence of gradient background, overlapping triangular areas (on the next item) and box-shadow etc.
The approach used is similar to that answer in the sense that two pseudo-elements are added to each li
element and they are skewed in the opposite directions to achieve the effect. The below are some of the additional steps that were done for your design:
- A pseudo-element (
:after
) is added to the ul
and a gradient that goes from semi-transparent white to transparent and then to a semi-transparent black is set as its background image. Size of this pseudo-element is lesser than the parent ul
container and this produces the gradient effect.
- Progressively decreasing
z-index
are assigned to each li
element to bring the earlier element forward and have its triangular bit be above the next element.
box-shadow
and border-right
are added to the li:before
and li:after
elements to get the arrow and its shadow.
- A solid white border and two
box-shadow
are added around the ul
.
The output is responsive as you can see in the "full page view" of the snippet.
ul {
position: relative;
margin: 0;
padding: 0;
line-height: 60px;
color: white;
font-weight: bold;
text-align: center;
text-transform: uppercase;
border: 2px solid white;
border-radius: 30px;
list-style-type: none;
box-shadow: 2px 2px 0px #DDD, -2px 2px 0px #DDD;
white-space: nowrap;
overflow: hidden;
}
li {
position: relative;
display: inline-block;
width: 33.33%;
text-indent: -20px;
}
li:before,
li:after {
position: absolute;
left: 0;
content: '';
height: 50%;
width: 100%;
background: rgb(31, 139, 188);
border-right: 3px solid rgb(87, 153, 190);
box-shadow: 3px -2px 2px rgba(0, 0, 0, 0.15);
}
li:first-child:before,
li:first-child:after {
background: rgb(255, 0, 0);
}
li:before {
top: 0px;
transform: skewX(45deg);
transform-origin: left bottom;
z-index: -1;
}
li:after {
bottom: 0px;
transform: skewX(-45deg);
transform-origin: left top;
z-index: -2;
}
li:first-child {
text-indent: 0px;
z-index: 2;
}
li:nth-of-type(2) {
z-index: 1;
}
li:last-child {
width: calc(33.33% + 15px);
}
ul:after {
position: absolute;
content: '';
top: 3px;
left: 3px;
height: calc(100% - 6px);
width: calc(100% - 6px);
background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0.5), rgba(0, 0, 0, 0) 25%, rgba(0, 0, 0, 0) 75%, rgba(0, 0, 0, 0.05));
border-radius: 25px;
z-index: 3;
pointer-events: none;
}
/* if you need hover effects */
li:hover:before,
li:hover:after {
background: yellowgreen;
}
<ul>
<li>Text</li
><li>Text</li
><li>Text</li>
<!-- > is added in next line intentionally to avoid space between inline block elements -->
</ul>