CSS之三角形的制作
程序员文章站
2024-02-20 14:26:22
...
用边框把宽高撑开,其他边设置为透明色或者背景色即可,再用position定位到任何地方去
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style type="text/css">
.box{
width: 0px;
height: 0px;
border-right: 100px solid transparent;
border-left: 100px solid transparent;
border-top: 100px solid transparent;
border-bottom: 100px solid #000000;
}
</style>
</head>
<body>
<div class="box">
</div>
</body>
</html>