看起来我来得太晚了,但无论如何都在这里。- jsFiddle
编辑- 添加different
样式代码并更新 jsFiddle
css
.strikethrough{
box-shadow:
0px -10px 0px 0px #EAEBEC inset, inset 0px -11px 0px 0px black;
background: #EAEBEC;
padding: 0 5px;
display: block;
text-align:center;
}
.strikethrough span{
background:#EAEBEC;
}
.different{
background:white;
}
.different .strikethrough{
box-shadow:
0px -10px 0px 0px #fff inset, inset 0px -11px 0px 0px black;
background: #fff;
padding: 0 5px;
display: block;
text-align:center;
}
.different .strikethrough span{
background:#fff;
}
html
<div class="strikethrough"> <span> Ou </span> </div>
<div class="different">
<div class="strikethrough"> <span> Ou </span>
</div>
</div>