用css3做一个三角形
作者:互联网
用css3做一个三角形
<style>
.up {
width: 0;
height: 0;
border-width: 0 30px 30px;
border-style: solid;
border-color: transparent transparent cyan;
margin-top: 10px;
}
.down {
width: 0;
height: 0;
border-width: 30px 30px 0;
border-style: solid;
border-color: cyan transparent transparent transparent;
margin-top: 10px;
}
.left {
width: 0;
height: 0;
border-width: 30px 30px 30px 0;
border-style: solid;
border-color: transparent cyan transparent;
margin-top: 10px;
}
.right {
width: 0;
height: 0;
border-width: 30px 0 30px 30px;
border-style: solid;
border-color: transparent cyan transparent;
margin-top: 10px;
}
</style>
<body>
<div class="up"></div>
<div class="down"></div>
<div class="left"></div>
<div class="right"></div>
</body>
结果如下
标签:css3,solid,style,一个,transparent,width,三角形,border,30px 来源: https://www.cnblogs.com/yuhuo123/p/15151560.html