加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 资源网站 > 资源 > 正文

HTML / CSS:图像/ div没有出现在Mozilla中但是在IE中?

发布时间:2020-12-14 23:33:44 所属栏目:资源 来源:网络整理
导读:无法弄清楚为什么在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/xht
无法弄清楚为什么在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>

解决方法

您需要围绕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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读