html - CSS - 如何设置背景图像在 IE11 中拉伸(stretch)

标签 html css image background stretch

如何在 Internet Explorer 11 中将背景图像设置为拉伸(stretch)?这是我正在使用的 CSS 代码(适用于除 IE 之外的所有其他浏览器):

  body {
background: url('/image.png') no-repeat center center fixed;
background-repeat: no-repeat;
background-position: center;
-webkit-background-size: 100% 100%;
-moz-background-size: 100% 100%;
-o-background-size: 100% 100%;
background-size: 100% 100%;

filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='/image.png', sizingMethod='scale');
-ms-filter: "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='/image.png', sizingMethod='scale')";
}

最佳答案

background: url('/image.png') no-repeat center center fixed;
background-size: cover;

设置背景大小覆盖

关于html - CSS - 如何设置背景图像在 IE11 中拉伸(stretch),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22506649/

相关文章:

css - 等距 DIV 也来自父边界

image - 如何在 Matlab 中显示 .bin 图像?

c# - 如何在 C# 中创建 16 位灰度 PNG?

html - IE下这个页面有黑框吗?

html - [CSS]视差效果和固定文本

html - 在Chrome浏览器的子输入内部拖动时,如何滚动父容器?

html - 将视频嵌入html导致操作被取消

HTML 向右浮动元素顺序

html - float 子 div 宽度不影响父宽度

image - 单元格中图像的线性组合