简体   繁体   English

HTML和CSS在Chrome和Firefox中可以正常工作,但在IE7上却不能

[英]HTML and CSS works fine in Chrome and Firefox but not IE7

I am developing a site at the moment for Google Sites, and am looking to embed the HTML below as a gadget to display my own custom menu bar. 我目前正在为Google协作平台开发一个网站,并希望将下面的HTML嵌入为一个小工具,以显示自己的自定义菜单栏。 I'm not a HTML or CSS expert so I took this sample code from a tutorial and attempted to use it myself. 我不是HTML或CSS专家,所以我从教程中获取了此示例代码,并尝试自己使用它。 The problem is that it works fine in Firefox and Chrome but not in IE7. 问题在于它在Firefox和Chrome中运行正常,但在IE7中却无法正常运行。

What is the best way to troubleshoot these types of issues? 解决此类问题的最佳方法是什么? Is there any tool that can perform an analysis within IE and let me know the issue? 有没有可以在IE中执行分析并让我知道该问题的工具?

Thanks 谢谢

<style type="text/css">
body {background-color:transparent}
.outer {display:block}
.outer img {width:100%; height:100%; border:0}
html>body .outer img {display:block}
.outer a:hover {visibility:visible}
.outer a:hover img {visibility:hidden}
#home {background-image:url(https://lh4.googleusercontent.com/-SM4Zlc_m4sE/ToUeELn6dYI/AAAAAAAAAA4/srLee9XEP5s/HomeOnHoverMenuTile.png)}
#news {background-image:url(https://lh4.googleusercontent.com/-UKhdMKoFs1o/ToUryay5cbI/AAAAAAAAACk/Fq4BprNrKYQ/NewsOnHoverMenuTile.png)}
#history {background-image:url(https://lh3.googleusercontent.com/-b41VthyFbjM/ToUeEYy8PQI/AAAAAAAAAA8/zTlQLkQaxrQ/HistoryOnHoverMenuTile.png)}
#clubgear {background-image:url(https://lh4.googleusercontent.com/-ihsPwNu_f6s/ToUeEPSC2XI/AAAAAAAAAA0/G-B6SVXR2DY/ClubGearOnHoverMenuTile.png)}


</style>
<base target="_parent">

<table align="center" style="background-color:#FFFFFF" cellpadding="0" cellspacing="0">
<tbody>
<tr>

<td><div class="outer" id="home"><a href="http://www.google.ie"><img src="https://lh5.googleusercontent.com/-p2m5ub3oghM/ToUqR7X0x-I/AAAAAAAAABo/5YYOpHVrN5E/HomeMenuTile.png"></a></div></td>
<td><div class="outer" id="news"><a href="http://www.google.ie"><img src="https://lh5.googleusercontent.com/-gZbD2wwe3no/ToUqRzW8KcI/AAAAAAAAABk/wErW3cRYDT0/NewsMenuTile.png"></a></div></td>
<td><div class="outer" id="history"><a href="http://www.google.ie"><img src="https://lh6.googleusercontent.com/-iRj10FazPSs/ToUqR82toZI/AAAAAAAAABg/3zOlviqH_ig/HistoryMenuTile.png"></a></div></td>
<td><div class="outer" id="clubgear"><a href="http://www.google.ie"><img src="https://lh4.googleusercontent.com/-4hwFSaBOUh4/ToUeE1XbIYI/AAAAAAAAABI/ngtqhT5gcIE/ClubGearMenuTile.png"></a></div></td>


</tr>
</tbody>
</table>

IE7 and below has some problems with visibility . IE7及以下版本在visibility方面存在一些问题。

So, these styles may be causing the errors for you: 因此,这些样式可能会为您造成错误:

.outer a:hover {visibility:visible}
.outer a:hover img {visibility:hidden}

You can read more here: http://reference.sitepoint.com/css/visibility 您可以在此处了解更多信息: http : //reference.sitepoint.com/css/visibility

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM