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>
Вы можете разместить код, который вы пробовали? – Harry
Я предлагаю использовать изображения для такого градиента. – Justinas
С такими формами, как градиенты и границы, я честно не считаю, что это выполнимо с помощью CSS. Возможно, вам лучше использовать изображения внутри div или что-то подобное. – Dellirium