用css写个按钮蓝色的带锐角
可以使用以下代码实现:
.button {
background-color: #007bff;
color: #fff;
border: none;
padding: 10px 20px;
border-radius: 5px;
}
.button::before {
content: "";
position: absolute;
top: 0;
left: 0;
width: 0;
height: 0;
border-top: 20px solid transparent;
border-right: 20px solid #007bff;
border-bottom: 20px solid transparent;
}
.button::after {
content: "";
position: absolute;
top: 0;
right: 0;
width: 0;
height: 0;
border-top: 20px solid transparent;
border-left: 20px solid #007bff;
border-bottom: 20px solid transparent;
}
在HTML中使用以下代码来创建按钮:
<button class="button">按钮</button>
这将创建一个带有蓝色背景和锐角的按钮。请注意,使用伪元素 ::before 和 ::after 来创建锐角效果。 border-radius 属性用于创建圆角。
原文地址: https://www.cveoy.top/t/topic/MdE 著作权归作者所有。请勿转载和采集!