菜单栏不起作用



对于我的学校,我需要创建一个网站,我已经尝试了几天来解决这个问题。菜单栏看起来很棒。但是我无法单击链接。如果你把鼠标悬停在链接上方,它应该显示一行,前两条线它会显示:Home和Componenten。其余的它没有显示,我无法单击它。这是我的HTML和CSS,我真的找不到问题

<!DOCTYPE html>
<html lang="nl">
<head>
<link href="contact.php" type="text/php">
<link rel="stylesheet" href="layout.css" type="text/css">
<title>webshop game artikelen</title>
</head>
<body>
<div id="container">
<table class="header-tabs" width="100%" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class="actief"><a href="index.html">Home</a></td>
<td style=" width: 120px;"><a href="component.html">Componenten</a></td>
<td><a href="randapparatuur.html">Randapparatuur</a></td>
<td><a href="laptop-amp-pc.html">Laptop &amp; PC</a></td>
<td><a href="tablets-amp-telefoons.html">Tablets &amp; Telefoons</a></td>
<td><a href="netwerk.html">Netwerk</a></td>
<td><a href="software.html">Software</a></td>
<td><a href="printing.html">Printing</a></td>
<td><a href="contact.html">Contact</a></td>
</tr>
</tbody>
</table>
<a href="contact.html"></a>
</div> <!--header-->
<div id="content">
<video poster="poster.jpg" width="618" height="347" controls preload> 
<source src="stopmotion.mp4" media="only screen and (min-device-width: 568px)"></source> 
<source src="stopmotion.mp4" media="only screen and (max-device-width: 568px)"></source> 
<source src="video.ogv"></source> 
</video>
</div> <!--content-->
<div id="footer">
2014, all right reserved
<a href="mailto:schoolscs%40gmail.com">Webmaster</a>
</div> <!--footer-->
</div> <!--container-->
</body>
</html>

这是我的 CSS

#page {width: 800px;
position: relative;
min-height: 100%;
height:auto !important; /* voor moderne browsers */
height:100%; /* voor IE */
}
/* blauwe menubalk */
.header-tabs {
float: left;
border-collapse: collapse;
border-spacing: 2px;
font-size: 11pt;
}
.header-tabs td a, .header-tabs td a:visited{
height: 26px;
background-color: #424C77;
color: #eff2fe;
font-size: 0.8em;
text-decoration: none;
display: block; 
line-height: 24px;
}
.header-tabs td.actief a{
background-color: #eff2fe;
color: #424C77;
}
.header-tabs td:hover a{
text-decoration: underline;
} 
/* //menu */
#content
{
background-color: ######;
width: 80%;
position:relative;
#footer 
{position: absolute; 
bottom: 0; /* heel belangrijk */ 
height: 20px; 
width: 100%; 
}

1) 从以下位置删除浮点数:

.header-tabs {
   border-collapse: collapse;
   border-spacing: 2px;
   font-size: 11pt;
}

演示

2)或者您可以清除表格后的浮点数,如下所示:

#container { position: relative; overflow: hidden; }

演示

3)或者您可以为容器增加高度:

#container { height: 26px; }

演示

并告诉你的学校教你现代html/css,放弃使用表格做这些事情。

最新更新