页脚背景在Internet Explorer中出现两次

时间:2012-11-02 03:25:49

标签: css internet-explorer

http://www.utahvalleyhealthclinic.com/services在所有版本的IE中出现两次页脚背景。我已经检查了HTML,并且页脚元素似乎在IE的HTML中出现了两次但在Chrome中没有出现。

我不清楚为什么会发生这种情况,因为我不记得将代码放在那里两次,我认为如果我有,它也会出现在Chrome中。我已经使用了一个标记验证器来检查页面,它说我错过了一大堆打开和关闭标签(当我查看代码时它实际上就存在了)。

有谁知道为什么会这样?

2 个答案:

答案 0 :(得分:2)

在页脚处,有两个锚标记<a>未关闭。解决这个问题,你的问题就会解决。

工作演示:http://jsfiddle.net/DpGyT/1/

更改

<div class="lbtns">
<a href="http://www.utahvalleyhealthclinic.com/contact-us"><img src="http://www.uvhc.mikeandjewels.com/wp-content/themes/thesis_185/custom/images/mapsbtn.png">
</div>
<div class="lbtns">
<a href="http://www.utahvalleyhealthclinic.com/patient-forms"><img src="http://www.uvhc.mikeandjewels.com/wp-content/themes/thesis_185/custom/images/frmsbtn.png">
</div>

<div class="lbtns">
    <a href="http://www.utahvalleyhealthclinic.com/contact-us"><img src="http://www.uvhc.mikeandjewels.com/wp-content/themes/thesis_185/custom/images/mapsbtn.png"></a>
</div>
<div class="lbtns">
    <a href="http://www.utahvalleyhealthclinic.com/patient-forms"><img src="http://www.uvhc.mikeandjewels.com/wp-content/themes/thesis_185/custom/images/frmsbtn.png"></a>
</div>

答案 1 :(得分:1)

此:

<a href="http://www.utahvalleyhealthclinic.com/patient-forms">

显然你没有关闭它,有些东西坏了。

尝试使用IE(F12)检查并同时查看代码以查找错误发生的原因。

基本上IE了解你有两个“页脚”DIV,虽然Chrome显示只有一个。

关于结束标签,请注意像<br />而不是<br><img ... />而不是<img ...>

这样的自动关闭标签。

尝试类似NetBeans的内容并使用自动缩进(或Google其他选项)。帮助很多人找到你忘记关闭的标签,看看它是否应该在哪里。