css url()在Internet Explorer 10中无法识别 [英] css url() not recognized in internet explorer 10

查看:133
本文介绍了css url()在Internet Explorer 10中无法识别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的CSS中有这一行:

I have this line in my CSS:

.ui-icon-zoom-in { content: url(images/16x16/ZoomIn.png); } 

我使用 jQuery UI Button小部件如下:

$("#zoomin").button({ text: false, icons: { primary: "ui-icom-zoom-in" } });

在Chrome中,我可以看到图片位于按钮的中央。

In Chrome, I can see the image centered within the button. However, in IE10, I do not see the image.

推荐答案

我在这里缺少了什么?方案

解决方案

content 属性仅适用于:before和:after伪元素。您应该将其更改为:

The content property is only valid on :before and :after pseudo-elements. You should change it to:

.ui-icon-zoom-in { 
  background: url(images/16x16/ZoomIn.png) no-repeat; 
  width:16px;
  height:16px;
}


$ b 属性,如果指定了有效的DOCTYPE。

Apart from that, IE8+ only supports content property if a valid DOCTYPE is specified.

这篇关于css url()在Internet Explorer 10中无法识别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆