代码之家  ›  专栏  ›  技术社区  ›  diggersworld

CSS3 Internet Explorer缩放背景筛选器:

  •  4
  • diggersworld  · 技术社区  · 14 年前

    我试图拉伸背景图像,使其始终填充窗口。

    使用CSS3,我在mozilla和chrome中进行了管理,但是在IE中遇到了困难。我以前在IE中进行过管理,但这次不起作用,这里是我的HTML和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');
    }
    

    我在用IE8。

    1 回复  |  直到 14 年前
        1
  •  16
  •   diggersworld    14 年前

    我想出来了。

    使用filter时图像的路径是相对于HTML页面而不是CSS文件的。