用一个div+css怎么实现?还这种可以填充颜色的
求代码!
<div class="rectangle">
新手
</div>
.rectangle{
margin:0 auto;
width:200px;
height:51px;
line-height:51px;
text-align:center;
position:relative;
border-top:1px solid #00F;
border-bottom:1px solid #00F;
}
.rectangle:before{
content:"";
position:absolute;
top:7px;
left:-19px;
width:36px;
border-top:1px solid #00F;
height:36px;
border-right:1px solid #00F;
transform:rotate(-135deg);
}
.rectangle:after{
content:"";
position:absolute;
top:7px;
right:-19px;
width:36px;
border-top:1px solid #00F;
height:36px;
border-right:1px solid #00F;
transform:rotate(45deg);
}
.box1{
width:200px;
height:50px;
background:red;
color:white;
text-align:center;
line-height:50px;
-webkit-clip-path:polygon(20px 0,180px 0,200px 10px,200px 40px,180px 50px,20px 50px,0 40px,0 10px);
margin-bottom:10px;
}
绿色的在四个角加上渐变,道理是一样的
5 回答1.4k 阅读
5 回答1.2k 阅读✓ 已解决
2 回答883 阅读✓ 已解决
4 回答998 阅读✓ 已解决
2 回答1.3k 阅读✓ 已解决
2 回答855 阅读✓ 已解决
2 回答1k 阅读✓ 已解决