gpt4 book ai didi

html - 如何使用 css 3 保持 flex 的边框

转载 作者:行者123 更新时间:2023-11-28 13:48:50 27 4
gpt4 key购买 nike

边框半径样式不适用于以下代码

HTML

<ul id="menu" class="menu">
<li class="active"><a href="#description">Limerick One</a></li>
<li><a href="#usage">Limerick Two</a></li>
<li><a href="#download">Limerick Three</a></li>
</ul>​

CSS:

.menu { padding: 0; clear: both; border-radius:10px; }
.menu li { display: inline; }

.menu li a {
padding: 6px; float:left;font-family:Gill, Helvetica, sans-serif; border-right: 1px solid #000; border-bottom: none;
text-decoration: none; color: #fff; font-weight: bold;
background-image: linear-gradient(bottom, rgb(68,68,68) 0%, rgb(34,34,34) 54%, rgb(68,68,68) 100%);
background-image: -o-linear-gradient(bottom, rgb(68,68,68) 0%, rgb(34,34,34) 54%, rgb(68,68,68) 100%);
background-image: -moz-linear-gradient(bottom, rgb(68,68,68) 0%, rgb(34,34,34) 54%, rgb(68,68,68) 100%);
background-image: -webkit-linear-gradient(bottom, rgb(68,68,68) 0%, rgb(34,34,34) 54%, rgb(68,68,68) 100%);
background-image: -ms-linear-gradient(bottom, rgb(68,68,68) 0%, rgb(34,34,34) 54%, rgb(68,68,68) 100%);

background-image: -webkit-gradient(
linear,
left bottom,
left top,
color-stop(0, rgb(68,68,68)),
color-stop(0.54, rgb(34,34,34)),
color-stop(1, rgb(68,68,68))
);
}

.menu li.active a {
background-image: linear-gradient(bottom, rgb(138,25,25) 0%, rgb(186,52,52) 54%, rgb(138,25,25) 100%);
background-image: -o-linear-gradient(bottom, rgb(138,25,25) 0%, rgb(186,52,52) 54%, rgb(138,25,25) 100%);
background-image: -moz-linear-gradient(bottom, rgb(138,25,25) 0%, rgb(186,52,52) 54%, rgb(138,25,25) 100%);
background-image: -webkit-linear-gradient(bottom, rgb(138,25,25) 0%, rgb(186,52,52) 54%, rgb(138,25,25) 100%);
background-image: -ms-linear-gradient(bottom, rgb(138,25,25) 0%, rgb(186,52,52) 54%, rgb(138,25,25) 100%);

background-image: -webkit-gradient(
linear,
left bottom,
left top,
color-stop(0, rgb(138,25,25)),
color-stop(0.54, rgb(186,52,52)),
color-stop(1, rgb(138,25,25))
);
}

.content {
float: left; clear: both;
background: #fff; padding: 10px 20px 20px; width: 400px;
}

这是 fiddle :http://jsfiddle.net/avkKL/

最佳答案

Children of an element with a border-radius will always bleed out of their parent .

您必须直接在要圆 Angular 的元素上设置border-radius:

.menu li:first-child a { border-radius: 10px 0 0 10px }
.menu li:last-child a { border-radius: 0 10px 10px 0 }

这是 fiddle :http://jsfiddle.net/avkKL/1/

关于html - 如何使用 css 3 保持 flex 的边框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11602027/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com