无法弄清楚为什么在IE中只显示div容器时图像没有出现Mozilla。有人知道任何解决方案吗?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Featured</title>
</head>
<body>
<!--#include virtual="/header.html" -->
<!--#include virtual="/alpha.html" -->
<div id="WhiteBody">
<center>
<p class="HeaderFont">FEATURED</p>
</center>
<div style=background-color:#D9BA26; height:480px; width:320px; >
<img src="images/Magic Hat #9.jpg" style=width:100%;height:100%; />
</div>
</div>
<!--#include virtual="/alpha.html" -->
<!--#include virtual="/footer.html" -->
</body>
</html>
答案 0 :(得分:5)
您需要围绕CSS属性引用
<div id="WhiteBody">
<center>
<p class="HeaderFont">FEATURED</p>
</center>
<div style="background-color:#D9BA26; height:480px; width:320px;" >
<img src="images/Magic Hat #9.jpg" style="width:100%;height:100%;" />
</div>
</div>
并尝试避免在图片名称中使用空格和特殊字符 - 将其设为Magic_Hat_9.jpg