用边框把宽高撑开,其他边设置为透明色或者背景色即可,再用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>
来源:CSDN
作者:九层之台 始于垒土
链接:https://blog.csdn.net/dwjdj/article/details/104106399