css 制作三角效果

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style type="text/css">
div {
/*css 边框可以模拟三角效果*/
0;
height: 0;
border-top: 10px solid red;
border-right: 10px solid green;
border-bottom: 10px solid blue;
border-left: 10px solid pink;
}
p {
0;
height: 0;
border-style: solid;
border- 10px;
border-color: transparent transparent transparent #f40;
/* 兼容低版本浏览器 */
font-size: 0;
line-height: 0;
}
</style>
</head>
<body>
<div></div>
<p></p>
</body>
</html>

原文地址:https://www.cnblogs.com/ericblog1992/p/12915900.html