css三角制作(二十课)
代码:
<style>
/* 边框原理 */
.box1 {
width: 0;
height: 0;
border-top: 100px solid pink;
border-bottom: 100px solid blue;
border-left: 100px solid yellow;
border-right: 100px solid greenyellow;
}
/* 三角制作 */
.box2 {
width: 0;
height: 0;
border: 100px solid transparent;
border-right: 100px solid greenyellow;
margin: 5px;
}
.jd {
position: relative;
width: 100px;
height: 100px;
background-color: pink;
}
.jd span {
position: absolute;
right: 10px;
top: -25px;
width: 0;
height: 0;
border: 10px solid transparent;
border-bottom: 10px solid greenyellow;
margin: 5px;
}
</style>
</head>
<body>
<div class="box1"></div>
<div class="box2"></div>
<div class="jd"><span></span></div>
</body>
</html>
原文地址:https://blog.csdn.net/2302_76722613/article/details/143780628
免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!