.tabs {
display: flex;
flex-direction: row;
overflow: visible;
padding-left: 15px;
}
.tab {
height: 0;
width: 130px;
height: 38px;
margin-left: -15px;
z-index: -1;
cursor: pointer;
background-size: contain;
background: transparent url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width=\"121px\" height=\"38px\" viewBox=\"0 0 121 38\"><path d=\"M0.786477689,37.3880765 L0.786477689,5 L0.786477689,5 C0.786477689,2.790861 2.57733869,1 4.78647769,1 L102.838012,1 L102.838012,1 C104.471746,1 105.941285,1.99354246 106.549997,3.50964209 L120.152151,37.3880765 L0.786477689,37.3880765 Z\" stroke=\"#979797\" fill=\"#F0F0F0\"></path></svg>") no-repeat;
}
.tab .label{
box-sizing: border-box;
padding: 12px;
text-align: center;
color: #444444;
font: 13px arial, sans-serif;
width: 90%;
}
.active {
background: transparent url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width=\"121px\" height=\"38px\" viewBox=\"0 0 121 38\"><path d=\"M0.786477689,37.3880765 L0.786477689,5 L0.786477689,5 C0.786477689,2.790861 2.57733869,1 4.78647769,1 L102.838012,1 L102.838012,1 C104.471746,1 105.941285,1.99354246 106.549997,3.50964209 L120.152151,37.3880765 L0.786477689,37.3880765 Z\" stroke=\"#2D94B5\" fill=\"#2D94B5\"></path></svg>") no-repeat;
z-index: 10;
}
.active .label{
color: #ffffff;
}
<div class="tabs">
<div class="tab"><div class="label">TAB 1</div></div>
<div class="tab"><div class="label">TAB 2</div></div>
<div class="tab active"><div class="label">TAB 3</div></div>
<div class="tab"><div class="label">TAB 4</div></div>
</div>
Doppelte hilft: https://stackoverflow.com/questions/7920754/how-to-draw-a-trapezium-trapezoid-with-css3 (Ich habe falsch gewählt, kann die Abstimmung jetzt nicht ändern. Aber das sollte noch geschlossen werden.) –
Mögliches Duplikat von [Wie zeichne ein Trapez/Trapez mit CSS3?] (Https://stackoverflow.com/questions/7920754/how-to-draw-a-trapezium-trapezoid-with -css3) – agrm
Danke für alle Antworten, aber wie Sie auf dem Bild sehen können, haben die trapezförmigen Tasten eine graue Grenze und das ist, was ich erreichen möchte. Die anderen Threads zeigen nur, wie man ein Trapez durch Verbinden von 2 Elementen erzeugt, aber wie füge ich einen Rahmen hinzu? – Cons7an7ine