CSS3 Internet Explorer缩放背景过滤器: [英] CSS3 Internet Explorer Scale Background filter:
本文介绍了CSS3 Internet Explorer缩放背景过滤器:的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
使用CSS3我已经管理它在mozilla和chrome,但是我努力在IE 。我在IE中管理过这个,但这一次它不工作,这里是我的HTML和CSS:
HTML5:
<!DOCTYPE html>
< html lang =en>
< head>
< meta charset =utf-8>
< meta name =descriptioncontent =>
< title> IndieCity.com注册< / title>
<! - CSS包含在这里 - >
< / head>
< body>
< div id =background>< / div>
< / body>
< / html>
CSS:
code> div#background {
position:absolute;
top:0px;
left:0px;
width:100%;
height:100%;
min-width:1024px;
min-height:768px;
display:block;
background:url(../ img / theme1.jpg)no-repeat;
background-size:100%;
-moz-background-size:100%;
filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src ='.. / img / theme1.jpg',sizingMethod ='scale');
}
我使用的是IE8。
使用过滤器时图像的路径是相对于HTML页面的,并且而不是CSS文件。
I'm trying to stretch a background image so it always fills the window.
Using CSS3 I have managed it in mozilla and chrome, however am struggling in IE. I have managed this before in IE but this time its not working, here's my HTML and CSS:
HTML5:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="description" content="">
<title>IndieCity.com Signup</title>
<!-- CSS gets included here -->
</head>
<body>
<div id="background"></div>
</body>
</html>
CSS:
div#background {
position: absolute;
top: 0px;
left: 0px;
width: 100%;
height: 100%;
min-width: 1024px;
min-height: 768px;
display: block;
background: url(../img/theme1.jpg) no-repeat;
background-size: 100%;
-moz-background-size: 100%;
filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../img/theme1.jpg', sizingMethod='scale');
}
I'm using IE8.
解决方案
I figured it out.
The path for the image when using filter is relative to the HTML page and not the CSS file.
这篇关于CSS3 Internet Explorer缩放背景过滤器:的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文