发布于2021-04-09 07:01 阅读(999) 评论(0) 点赞(2) 收藏(4)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<div class="trangle"></div>
</body>
</html>
<style>
* {
margin: 0;
padding: 0;
}
.trangle {
margin: 0 auto;
margin-top: 100px;
width: 0;
height: 0;
border: 200px solid #909399;
border-top-color: #409EFF;
border-bottom-color: #67C23A;
border-left-color: #E6A23C;
border-right-color: #F56C6C;
}
</style>
border-bottom: 0;
border-left-color: transparent;
border-right-color: transparent;
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<div class="trangle"></div>
</body>
</html>
<style>
* {
margin: 0;
padding: 0;
}
.trangle {
margin: 0 auto;
margin-top: 100px;
width: 0;
height: 0;
border: 200px solid #909399;
border-top-color: #409EFF;
border-bottom-color: #67C23A;
border-left-color: #E6A23C;
border-right-color: #F56C6C;
/* 根据需要调整方位 */
border-bottom: 0;
border-left-color: transparent;
border-right-color: transparent;
}
</style>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<div class="trangle"></div>
</body>
</html>
<style>
* {
margin: 0;
padding: 0;
}
.trangle {
margin: 0 auto;
margin-top: 100px;
width: 0;
height: 0;
border-bottom: 200px solid #67C23A;
border-left: 200px solid transparent;
border-right: 200px solid transparent;
}
</style>
.trangle::after {
content: "";
z-index: 99;
border-left: 197px solid transparent;
border-right: 197px solid transparent;
border-bottom: 197px solid white;
position: absolute;
top: 101px;
left: 103px;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<div class="trangle"></div>
</body>
</html>
<style>
* {
margin: 0;
padding: 0;
}
.trangle {
margin-left: 100px;
margin-top: 100px;
width: 0;
height: 0;
border-bottom: 200px solid #67C23A;
border-left: 200px solid transparent;
border-right: 200px solid transparent;
/* 与后面有关的代码 */
z-index: 1;
}
.trangle::after {
content: "";
z-index: 99;
border-left: 197px solid transparent;
border-right: 197px solid transparent;
border-bottom: 197px solid white;
position: absolute;
top: 101px;
left: 103px;
}
</style>
原文链接:https://blog.csdn.net/awwwwmman/article/details/115498259
作者:程序员的人生
链接:http://www.qianduanheidong.com/blog/article/58524/fdfc68589fbc1cefbf45/
来源:前端黑洞网
任何形式的转载都请注明出处,如有侵权 一经发现 必将追究其法律责任
昵称:
评论内容:(最多支持255个字符)
---无人问津也好,技不如人也罢,你都要试着安静下来,去做自己该做的事,而不是让内心的烦躁、焦虑,坏掉你本来就不多的热情和定力
Copyright © 2018-2021 前端黑洞网 All Rights Reserved 版权所有,并保留所有权利。 京ICP备18063182号-3
投诉与举报,广告合作请联系vgs_info@163.com或QQ3083709327
免责声明:网站文章均由用户上传,仅供读者学习交流使用,禁止用做商业用途。若文章涉及色情,反动,侵权等违法信息,请向我们举报,一经核实我们会立即删除!