【问题标题】:Center background image in Internet Explorer在 Internet Explorer 中居中背景图像
【发布时间】:2013-10-31 20:02:54
【问题描述】:

有人知道如何在 Internet Explorer 的页面上居中显示图像吗?我用这个,但是没用

body{

margin:0;
padding:0;

font-family:"Arial", Times, serif;
font-size:10px;
width:100%;
height:100%;
background-image:url('background.png') center    top;
background-position:center top;
background-repeat:no-repeat;
background-color:#cfddef ;

}

这也没有用

body{

margin:0;
padding:0;

font-family:"Arial", Times, serif;
font-size:10px;
width:100%;
height:100%;
background: #cfddef url("background.png") no-repeat center top;

}

谢谢你的回答:)

【问题讨论】:

  • 这应该可行......我们需要看到它的实际效果。请创建一个 JSFiddle。注意background-image:url('background.png') center top; 应该只是background-image:url('background.png');
  • 您是否遇到了特定版本的 IE 问题?
  • 你在重复自己。试试简写版背景:#cfddef url("background.png") no-repeat center top;
  • 我的站点是velvetart.net,但是当你的屏幕分辨率为1366x768px时它会起作用,因为背景图像具有相同的宽度
  • 就像@Paulie_D所说的只是background-image句子中的center top

标签: html css internet-explorer background position


【解决方案1】:

检查此fiddle。这是你想要的?

body{
margin:0;
padding:0;

font-family:"Arial", Times, serif;
font-size:10px;
width:100%;
height:100%;


background-image:url('http://storage3d.com/storage/2007.02/2aae1d60e516d24a40230e01ee33a00f.jpg');
background-repeat:no-repeat;
background-position:center;
    background-attachment:fixed;


background-color:#cfddef ;

}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-03-18
    • 2017-06-27
    • 2015-04-28
    • 2011-06-14
    • 2013-07-30
    • 2012-11-09
    • 2010-12-28
    • 1970-01-01
    相关资源
    最近更新 更多