gpt4 book ai didi

html - 在 CSS 中为尖按钮制作轮廓边框

转载 作者:行者123 更新时间:2023-11-28 10:48:03 24 4
gpt4 key购买 nike

是否可以在 CSS 中制作一个如下图所示的按钮。我试过 jsfiddle我可以得到一个实心形状,但不能得到一个带有轮廓边框的形状?

pointy button

jsfiddle代码:

            <div class="point-btn"></div>

.point-btn
{
width: 148px;
height: 34px;
background: #0a187e;
position: relative;
-moz-border-radius:3px 0 0 3px;
-webkit-border-radius:3px 0 0 3px;
border-radius:3px 0 0 3px;
margin-left:50px;
}
.point-btn:before
{
content:"";
position: absolute;
left: 100%;
width: 0;
height: 0;
border-top: 17px solid transparent;
border-left: 14px solid #0a187e;
border-bottom: 17px solid transparent;
}

最佳答案

不太漂亮 - 但你应该有一个不错的起点,只需使用另一个伪元素覆盖在你现有的三 Angular 形上:

Demo Fiddle

.point-btn {
width: 148px;
height: 28px;
border: 2px solid #0a187e;
background: #fff;
position: relative;
-moz-border-radius: 3px 0 0 3px;
-webkit-border-radius: 3px 0 0 3px;
border-radius: 3px 0 0 3px;
margin-left: 50px;
}
.point-btn:after {
content: "";
position: absolute;
left: 100%;
width: 0;
height: 0;
top: 0px;
border-top: 14px solid transparent;
border-left: 10px solid #fff;
border-bottom: 14px solid transparent;
}
.point-btn:before {
content: "";
position: absolute;
left: 100%;
width: 0;
top: -4px;
height: 0;
border-top: 18px solid transparent;
border-left: 14px solid #0a187e;
border-bottom: 17px solid transparent;
}
<div class="point-btn"></div>

关于html - 在 CSS 中为尖按钮制作轮廓边框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24861697/

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