CSS3倒三角形
发布时间:2021-07-20, 01:12:06 分类:HTML | 编辑 off 网址 | 辅助
图集1/1
正文 1792字数 186,908阅读
css:
.triangle-left {
width:0;
height:0;
border-right:20px solid yellow;
border-top:20px solid transparent;
border-bottom:20px solid transparent;
}
.triangle-up {
width:0;
height:0;
border-bottom:20px solid yellow;
border-left:20px solid transparent;
border-right:20px solid transparent;
}
.triangle-right {
width:0;
height:0;
border-left:20px solid yellow;
border-top:20px solid transparent;
border-bottom:20px solid transparent;
}
.triangle-down {
width:0;
height:0;
border-top:20px solid yellow;
border-left:20px solid transparent;
border-right:20px solid transparent;
}
Run code
Cut to clipboard
效果预览,请运行下面代码
<!DOCTYPE html>
<html>
<head>
<meta charset="gb2312" />
<title>无标题文档</title>
<style>
.triangle-left {
width:0;
height:0;
border-right:20px solid yellow;
border-top:20px solid transparent;
border-bottom:20px solid transparent;
}
.triangle-up {
width:0;
height:0;
border-bottom:20px solid yellow;
border-left:20px solid transparent;
border-right:20px solid transparent;
}
.triangle-right {
width:0;
height:0;
border-left:20px solid yellow;
border-top:20px solid transparent;
border-bottom:20px solid transparent;
}
.triangle-down {
width:0;
height:0;
border-top:20px solid yellow;
border-left:20px solid transparent;
border-right:20px solid transparent;
}
</style>
</head>
<body>
<div class="triangle-left"></div>
<div class="triangle-up"></div>
<div class="triangle-right"></div>
<div class="triangle-down"></div>
</body>
</html>
Run code
Cut to clipboard
(支付宝)给作者钱财以资鼓励 (微信)→
有过 1 条评论 »