我想要有圆形边框的标签,边框和内容之间有一个奇怪的间隙.有人能帮我把它处理掉吗?
Sandbox 链接: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>
一个类似的问题:Gap between background (or children) and rounded border