我可以做钻石,我可以用 CSS 做条纹。我在将两者合并以获得条纹钻石时遇到问题。请看我的小提琴(适用于 Chrome)。
如何制作条纹钻石?
#diamond {
width: 0;
height: 0;
border: 80px solid transparent;
border-bottom: 40px solid red;
position: relative;
top: -80px
}
#diamond:after {
content:'';
position: absolute;
left: -80px;
top: 40px;
width: 0;
height: 0;
border: 80px solid transparent;
border-top: 40px solid red;
}
.stripes {
height: 80px;
width: 160px;
background-size: 4px;
background-color: red;
background-image: -webkit-gradient(linear, 0 0, 100% 0, color-stop(.5, rgba(255, 255, 255, 1)), color-stop(.5, transparent), to(transparent));
}