【发布时间】:2016-07-12 19:54:45
【问题描述】:
我有这个带有伪元素的形状:
https://jsfiddle.net/6gf1m3j5/
body {
margin: 0;
background:#ccc;
}
#octagon-left {
background: red none repeat scroll 0 0;
height: 60px;
width: 100%;
}
#octagon-left::before {
border-left: 100px solid white;
border-top: 60px solid red;
content: "";
height: 0;
margin: 0;
position: absolute;
top: 0;
width: 40px;
}
#octagon-left::after {
border-right: 100px solid white;
border-top: 60px solid red;
content: "";
height: 0;
margin: 0;
position: absolute;
right: 0;
top: 0;
width: 40px;
}
这里的问题是左右角的白色。
如果我这样做,左边框:100px 纯透明;以红色为主。
我该怎么做?
非常感谢您的支持,谢谢。
【问题讨论】:
标签: css shape pseudo-element