链接工作之前,但最近更新后失败?

时间:2014-02-16 01:08:09

标签: html css

我在工作之前有导航,当你在导航器上盘旋时,它会突出显示红色并且可以点击(带你到另一个URL)。在我插入其他一些代码之后,它似乎不再起作用了......有什么建议吗?

HTML

<body>
<div id="page-wrap">
    <div id="header">
        <img src="images/header.png" />
    </div>
    <img src="images/navbar.png" />
    <ul id="nav">
        <li><a href="http://www.voyage-us.com">Home</a></li>
        <li><a href="http://www.voyage-us.com/xenforo/upload/index.php">Forums</a></li>
        <li><a href="http://www.google.com">Members</a></li>
        <li><a href="http://www.google.com">Streams</a></li>
        <li><a href="http://www.google.com">Contact Us</a></li>
    </ul>
    <div id="mainbody">
        <img src="images/mainbody.png" /></div>

    <div class="news1">
        <img src="images/news1.png" /></div>

    <div class="teamspeak">  <!--Teamspeak IMG-->
        <img src="images/teamspeak.png" /></div>

    <div id="ts3viewer_1037062" /></div>  <!-- Teamspeak Widget -->

        <script type="text/javascript" src="http://static.tsviewer.com/short_expire/js/ts3viewer_loader.js"></script>

        <script type="text/javascript">
        <!--
        var ts3v_url_1 = "http://www.tsviewer.com/ts3viewer.php?ID=1037062&text=000000&text_size=12&text_family=2&js=1&text_s_color=ffffff&text_s_weight=bold&text_s_style=normal&text_s_variant=normal&text_s_decoration=none&text_s_color_h=ffffff&text_s_weight_h=bold&text_s_style_h=normal&text_s_variant_h=normal&text_s_decoration_h=underline&text_i_color=ffffff&text_i_weight=normal&text_i_style=normal&text_i_variant=normal&text_i_decoration=none&text_i_color_h=ffffff&text_i_weight_h=normal&text_i_style_h=normal&text_i_variant_h=normal&text_i_decoration_h=underline&text_c_color=ffffff&text_c_weight=normal&text_c_style=normal&text_c_variant=normal&text_c_decoration=none&text_c_color_h=ffffff&text_c_weight_h=normal&text_c_style_h=normal&text_c_variant_h=normal&text_c_decoration_h=underline&text_u_color=ffffff&text_u_weight=bold&text_u_style=normal&text_u_variant=normal&text_u_decoration=none&text_u_color_h=ffffff&text_u_weight_h=bold&text_u_style_h=normal&text_u_variant_h=normal&text_u_decoration_h=none";
        ts3v_display.init(ts3v_url_1, 1037062, 100);
        -->
        </script>

    <div id="footer">
        <p>&copy;2014 Rythmn Designs<p>
</div>
</body>

CSS

body
{
margin: 0px;
padding: 0px;
background: url("http://puu.sh/6RlKi.png")
}

.clear
{
clear:both;
}

#page-wrap
{
width: 1019px;
margin: 0 auto;
}

#header
{
width:100%;
text-align: center;
display: block;
}

#nav
{
height: 0.1px;
list-style: none;
padding-left: 14px;
text-align: center;
padding-bottom: 0px;
margin: -14px;
margin-top: -15px;
}

#nav li a
{
position:relative;
top: -12px;
display: block;
width: 100px;
float: left;
color: white;
font-size:  14.09px;
text-decoration: none;
font-family:"BankGothic Md BT"
}

#nav li a:hover, #nav li a:active
{
color: red;
}

#mainbody
{
vertical-align:top;
position:relative
}

.news1
{
position: absolute;
top: 435px;
right: 815px
}

.teamspeak
{
position: absolute;
top: 435px;
right: 470px

}

#ts3viewer_1037062
{
position:absolute;
top: 465px;
right: 478px;
width: 290px;
height:190px;
overflow:auto;
}

#footer
{
background: #181818;
color: white;
padding: 20px 0 20px 0;
text-transform: uppercase;
border-top: 15px solid #828080;
text-align: center;
font-family:"BankGothic Md BT";
font-size:  12px;
position: relative;
}

这是玩具的JSFIDDLE - http://jsfiddle.net/rdL2m/

2 个答案:

答案 0 :(得分:0)

完全按照#nav:

的外观应用这些样式
#nav {
  margin: 0;
  padding: 0 0 0 25px;
  z-index: 100;
  position: absolute;
  top: 352px;
  list-style: none;
}

不应包括任何其他内容。只有您在上面看到的内容应该应用于#nav。

现在,在你的'#nav li a'样式中,删除这些:

{
  top: -12px;
  display: block;
  float: left;
}

现在到你的李,添加:

#nav li { 
  display: inline-block;
}

你的菜单应该很棒。您所要做的就是将左/右填充应用于li或锚元素,以实现链接之间所需的间距。

答案 1 :(得分:0)

尝试在标题 div 中添加菜单项,并为导航栏单独设置 div 。您还忘记关闭 div 作为页脚。