在CSS3中创建这种特殊形状/形状组合的方法比我目前做的更容易或更好吗?我已经尝试了一些不同的东西。我如何创建这个特定的形状?
向下的三角形应该坐在三条线的下方,但我似乎无法得到它。
我希望它看起来像这样:
https://jsfiddle.net/s6bcjzjr/
.triangle-container {
top: 0;
width: 30px;
height: 40px;
position: relative;
border-bottom: 2px solid #e74c3c;
}
.triangle {
position: relative;
margin: auto;
top: 30px;
left: 0;
right: 0;
width: 21px;
height: 21px;
transform: rotate(45deg);
-webkit-transform: rotate(45deg);
-moz-transform: rotate(45deg);
-o-transform: rotate(45deg);
-ms-transform: rotate(45deg);
border-right: 2px solid #e74c3c;
border-bottom: 2px solid #e74c3c;
}
.line {
width: 30px;
position: relative;
border-bottom: 2px solid #e74c3c;
margin-top: 3px;
}
<a href="#" class="open">
<div class="line"></div>
<div class="line"></div>
<div class="line"></div>
<div class="triangle-container">
<div class="triangle"></div>
</div>
</a>
请告诉我你错了,现在正在做的方式? – putvande
我不能让向下的三角坐在我想要的位置......(就在三条线的下面)看到我刚刚添加的图像示例。 – FuManchuNZ
使用SVG ...更简单吗? –