【问题标题】:Icon showing in Chrome & firefox but not in IE图标在 Chrome 和 firefox 中显示,但在 IE 中不显示
【发布时间】:2015-01-11 14:30:41
【问题描述】:

这是我从 IE 中提取的 CSS:

.hglghts .active.yes-icon, .hglghts .yes-icon {
    background: url("../img/yes_sir.png") no-repeat;
    width: 27px;
    background-position: initial;
    display: inline-block;
    opacity: 1;
    margin-right: -5px;
    vertical-align: middle;
    height: 17px;
    position: relative;
    top: 1px;
}

它没有显示。我使用的是 IE11。

这是我从 Chrome 中提取的内容,同样的内容,但正在显示?

.hglghts .yes-icon.active, .hglghts .yes-icon {
    background: url("../img/yes_sir.png") no-repeat;
    width: 27px;
    background-position: initial!important;
    display: inline-block;
    opacity: 1;
    margin-right: -5px;
    vertical-align: middle;
    height: 17px;
    position: relative;
    top: 1px;
}

谁能告诉我我做错了什么?

【问题讨论】:

标签: css internet-explorer


【解决方案1】:

问题应该在initial背景位置。

left top0 0 代替。

background-position: left top;

或者更好,在一行中:

background: url("../img/yes_sir.png") left top no-repeat;

【讨论】:

  • 我把它改成了:url("../img/yes_sir.png") left top no-repeat。还是没有图片?
猜你喜欢
  • 2023-03-17
  • 2012-09-16
  • 1970-01-01
  • 2018-10-09
  • 1970-01-01
  • 1970-01-01
  • 2015-12-17
  • 2017-09-21
  • 2021-07-11
相关资源
最近更新 更多