小编vad*_*ims的帖子

CSS元素之前和之后的CSS在Edge和IE 11中不起作用

我有问题显示一个带有角度侧面的按钮,使用css:before和:after伪元素.它适用于Chrome和Firefox,但不适用于Edge和IE 11.可能会出现什么问题?

a { text-decoration: none }
.container { margin: 20px; }
.font-jos {
  font-family: Verdana;
}
.btn-ribbon {
  position: relative;
  display:inline-block;
  padding: 13px 11px;
  background-color: #b46b78;
  color: #fff;
  font-size: 15px;
  line-height: 18px;
  font-weight: 700;
  letter-spacing: 0.05em;
  border-radius: 0;
  border: none;
  margin-left: 20px;
  text-transform: uppercase;
}
.btn-ribbon:before {
    content: "";
    position: absolute;
    top: 0;
    left: -10px;
    display: block;
    width: 0;
    height: 0;
    border-top: 22px solid #b46b78;
    border-bottom: 22px solid #b46b78;
    border-left: 10px solid #fff0;
    z-index: 1;
}
.btn-ribbon:after {
    content: …
Run Code Online (Sandbox Code Playgroud)

css internet-explorer pseudo-element microsoft-edge

0
推荐指数
1
解决办法
5942
查看次数