I want to have tabs with rounded borders and there is a weird gap between the border and the content. Can anyone help me get rid of it?
Sandbox link: https://codesandbox.io/s/borders-on-tabs-95cwzp?file=/index.html
body {
font-family: sans-serif;
}
.container {
display: flex;
justify-content: center;
zoom: 2; /* just to see it better */
}
ul {
list-style: none;
display: flex;
display: flex;
list-style: none;
border: 1px solid #133275;
border-radius: 16px;
background-color: #9db4d6;
overflow: hidden;
/* To reset browser native styles */
margin: 0;
margin-block-start: 0;
margin-block-end: 0;
margin-inline-start: 0;
margin-inline-end: 0;
padding-inline-start: 0;
}
li {
padding: 6px 12px;
font-size: 20px;
border-radius: 16px;
}
li.active {
background-color: #133275;
color: white;
}
<html>
<body>
<div class="container">
<ul>
<li class="active">First tab</Item>
<li>Second tab</Item>
</ul>
</div>
</body>
</html>
A question similar to this one: Gap between background (or children) and rounded border
