<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
div{
position: relative;
width: 300px;
height: 200px;
background-color: pink;
margin: 100px auto;
}
p{
position: absolute;
top:50%;
margin-top: -20px;
width: 0;
height: 0;
/*transparent是透明色*/
border-top: 20px solid transparent;
border-right: 20px solid transparent;
border-bottom: 20px solid red;
border-left: 20px solid transparent;
}
</style>
</head>
<body>
<div>
<p></p>
</div>
</body>
</html>
css三角之美
最新推荐文章于 2020-10-13 14:59:43 发布