.square{ width:0; height:0; margin:0 auto; border:6px solid transparent; border-bottom: 6px solid red; //自行调整方向,. }
带缺口的三角形:
<div class="box b1"></div> <div class="box b2"></div>
.box{ position: absolute; left: 0; top: 0; width: 0; height:0; border: 6px solid transparent; } .b1{ border-bottom-color:#000 ; } .b2{ border-bottom-color:#fff ; }
时间: 2024-09-28 19:19:23