我知道可以使用以下代码创建六边形:
.hex:before {
content: " ";
width: 0; height: 0;
border-bottom: 30px solid #6C6;
border-left: 52px solid transparent;
border-right: 52px solid transparent;
position: absolute;
top: -30px;
}
.hex {
margin-top: 30px;
width: 104px;
height: 60px;
background-color: #6C6;
position: relative;
}
.hex:after {
content: "";
width: 0;
position: absolute;
bottom: -30px;
border-top: 30px solid #6C6;
border-left: 52px solid transparent;
border-right: 52px solid transparent;
}
Run Code Online (Sandbox Code Playgroud)
如何创建一个填充了一种颜色并用另一种颜色勾勒出来的六边形?我试图摆弄它,但似乎不可能.
欢迎任何其他选择,我想避免使用图像.