图示
代码如下
<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta http-equiv="X-UA-Compatible" content="ie=edge"><title>Document</title><style>.top-san {width: 0;height: 0;border-left: 50px solid transparent;border-right: 50px solid transparent;border-bottom: 100px solid #ff0066;margin-bottom: 10px;}.bottom-san {width: 0;height: 0;border-left: 50px solid transparent;border-right: 50px solid transparent;border-top: 100px solid red;}.left-san {width: 0;height: 0;border-top: 50px solid transparent;border-right: 100px solid #0066ff;border-bottom: 50px solid transparent;}.right-san {width: 0;height: 0;border-top: 50px solid transparent;border-left: 100px solid #333;border-bottom: 50px solid transparent;}#demo {width: 0;height: 0;position: relative;border-top: solid 50px transparent;border-right: solid 50px black;/* 黑色大三角形 */border-bottom: solid 50px transparent;}#demo:after {content: "";width: 0;height: 0;position: absolute;left: 3px;top: -45px;border-top: solid 45px transparent;border-right: solid 45px white;/* 白色小三角形 */border-bottom: solid 45px transparent;}</style></head><body><div class="top-san"></div><div class="bottom-san"></div><div class="left-san"></div><div class="right-san"></div><div id="demo"></div></body></html>