在CSS中,我们经常需要创建一些三角箭头来装饰网页,但是有时我们不仅需要一个块级元素,而且需要在箭头周围描边。这时候,CSS三角箭头描边就派上用场了。 首先,我们需要创建一个带箭头的块级元素,这可以使
.arrow { display: inline-block; width: 0; height: 0; border: 10px solid transparent; border-right: 10px solid black; position: relative; } <br> .arrow:before { content: ""; position: absolute; top: -20px; left: -10px; width: 0; height: 0; border: 10px solid transparent; border-right: 10px solid black; transform: rotate(-45deg); }
.arrow { display: inline-block; width: 0; height: 0; border: 10px solid transparent; border-right: 10px solid black; position: relative; box-shadow: 0 0 0 2px gray; } <br> .arrow:before { content: ""; position: absolute; top: -20px; left: -10px; width: 0; height: 0; border: 10px solid transparent; border-right: 10px solid black; transform: rotate(-45deg); box-shadow: 0 0 0 2px gray; }
粉丝
0
关注
0
收藏
0