背景CSS没有出现在IE9中

时间:2013-01-07 12:59:14

标签: html css image background-image

我尝试了这些代码,由于某种原因,IE9中没有显示背景。兼容模式已关闭,它在IE9模式下运行。它在IE 10,Chrome和Firefox中运行良好。

body {
  background : url('/img/fade.png') repeat-x,
  url('/img/fadeh.png') repeat-y,
  url('/img/bg.png') repeat,
  ;
}

第二次尝试:

body {
  /*background-image: url(img/fade.png), url(img/fadeh.png), url(img/bg.png);
  background-repeat: repeat-x, repeat-y, repeat;*/
}

任何帮助表示赞赏!

由于

2 个答案:

答案 0 :(得分:2)

<!DOCTYPE html>

ie9在没有带有多个背景图像的doctype的情况下中断

编辑:

也可以试试你的css

body {
    height:100%;
}

答案 1 :(得分:0)

这是因为您在最后一个背景网址上添加了,

替换为

body{
   background:url('/img/fade.png') repeat-x,
   url('/img/fadeh.png') repeat-y,
   url('/img/bg.png') repeat;
}

示例jsFiddle DEMO: http://jsfiddle.net/enve/5p4GS/