【问题标题】:Internet Explorer CompatibilityInternet Explorer 兼容性
【发布时间】:2013-05-29 12:56:24
【问题描述】:

我在网站上嵌入了下面的代码(html、javascript、css),尽管它在任何版本(最后一个)的 firefox 和 chrome 上都能正常工作,但在 Internet Explorer 上却不能正常工作9 岁或以上。

不能正常工作是指链接不能正常工作(没有导航)。对不起,我不够清楚...... 我的代码有什么错误或遗漏吗?我可以添加一些东西吗? 我试图在

之间添加那个元标记
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> 

但什么也没发生。

我的代码是:

<!DOCTYPE html>
<html>
<head>
<style>
body{font-family:verdana; font-size:25px}
table{font-size:80%;background:181919}
a{color:white;text-decoration:none;font:bold }
a:hover{color:#009ED8}
td.menu{background:#181919}
table.menu
{

font-size:100%;
position:absolute;
visibility:hidden;
}
</style>
<script>
function showmenu(elmnt)
{
document.getElementById(elmnt).style.visibility="visible";
}
function hidemenu(elmnt)
{
document.getElementById(elmnt).style.visibility="hidden";
}
</script>
</head>

<body>

<table width="100%" border = 0>
 <tr bgcolor="181919" >
  <td onmouseover="showmenu('home')" onmouseout="hidemenu('home')" width="15%">
   <a href="http://www.test.com" target=_top>Αρχική</a><br>

  </td>

<td onmouseover="showmenu('company')" onmouseout="hidemenu('company')" width="25%">
   <a href=" http://www.test.com" target=_top>Η εταιρία μας</a><br>
  </td>
  <td onmouseover="showmenu('properties')" onmouseout="hidemenu('properties')" width="20%">
   <a href=" http://www.test.com" target=_top>Ακίνητα</a><br>
   <table class="menu" id="properties" width="120">
<tr><td><br></td></tr>
   <tr><td class="menu"><a href=" http://www.test.com" target=_top>Πώληση</a></td></tr>
   <tr><td class="menu"><a href=" http://www.test.com" target=_top>Ενοικίαση</a></td></tr>
   <tr><td class="menu"><a href=" http://www.test.com" target=_top>Μισθωμένα</a></td></tr>
   <tr><td class="menu"><a href="http://www.test.com" target=_top>Υπό κατασκευή</a></td></tr>

   </table>
  </td>
  <td onmouseover="showmenu('contact')" onmouseout="hidemenu('contact')" width="20%">
   <a href=" http://www.test.com" target=_top>Επικοινωνία</a><br>
   <table class="menu" id="contact" width="120">


   </table>
</td>
  <td onmouseover="showmenu('press')" onmouseout="hidemenu('press')" width="20%">
 <a href=" http://www.test.com" target=_top>Γραφείο Τύπου</a><br>
   <table class="menu" id="press" width="120">
<tr><td><br></td></tr>
   <tr><td class="menu"><a href="http://www.test.com" target=_top>Ανακοινώσεις</a></td></tr>
   <tr><td class="menu"><a href=" http://www.test.com" target=_top>Οικονομικά Στοιχεία</a></td></tr>


   </table>
  </td>

 </tr>
</table>
</body>

</html>

【问题讨论】:

  • “不工作”到底是什么意思?不工作如何?控制台有错误吗?
  • 什么意思,不能正常工作?您在控制台中遇到什么错误?
  • “工作不正常” - 请解释一下“正常”是什么意思。也就是说,添加对所需行为和实际行为的解释。 (顺便说一句,您要显示和隐藏的 'home''company' 元素在哪里?其他鼠标悬停有相应的元素,但没有这两个元素。)
  • 您是否查看了开发工具以查看是否出现错误?你在那儿看到什么了吗?
  • 我把它放在一个 jsfiddle 中,它似乎工作得很好。 jsfiddle.net/PVUBd/5

标签: javascript html css internet-explorer cross-browser


【解决方案1】:

IE9 或更早版本不完全支持最新的 html5 标签。 html5最好用chrome。

【讨论】:

  • IE8 更糟糕,但是有一些 js 插件可以提供它们的兼容性,例如 html5shiv
猜你喜欢
  • 2012-07-18
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-08-24
  • 2012-12-11
  • 1970-01-01
  • 2014-02-01
  • 1970-01-01
相关资源
最近更新 更多