IE 8:background-size修复 [英] IE 8: background-size fix

查看:111
本文介绍了IE 8:background-size修复的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已尝试在IE中添加背景尺寸,但它不起作用:

I've tried to add background size to IE but it's not working at all:

HTML

<h2 id="news">Notícias <img src="white-marker.png" alt="" /></h2>

CSS:

div#content h2#news {
    background: url('../images/news-background.jpg') no-repeat;
    background-size: 100%;
    border-radius: 20px;
    color: #fff;
    margin: 20px 0 0 20px;
    padding: 8px 20px;
    width: 90%;
    -moz-background-size: 100%;
    -moz-border-radius: 20px;
    -webkit-background-size: 100%;
    -webkit-border-radius: 20px;
}

过滤器

推荐答案

由'Dan'在类似的线程发布,如果你不使用sprite,可能有一个修复:

As posted by 'Dan' in a similar thread, there is a possible fix if you're not using a sprite:

在IE中制作背景大小的工作?

filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(
src='images/logo.gif',
sizingMethod='scale');

-ms-filter: "progid:DXImageTransform.Microsoft.AlphaImageLoader(
src='images/logo.gif',
sizingMethod='scale')";




但是,这会缩放整个图像以适合分配的区域。所以
如果你使用sprite,这可能会导致问题。

However, this scales the entire image to fit in the allocated area. So if your using a sprite, this may cause issues.

注意
过滤器有缺陷,分配区域内的任何链接都不再可点击。

Caution
The filter has a flaw, any links inside the allocated area are no longer clickable.

这篇关于IE 8:background-size修复的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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