需要删除">"下拉菜单中的箭头

时间:2014-07-31 15:45:38

标签: html css menu

我目前正在开设一个网站:http://www.psych.utoronto.ca/users/ferber

如果将鼠标悬停在主菜单上的“资源”标签上,您会看到我编码的下拉菜单。但是,出于某种原因,此下拉菜单上的标签会附带“>”箭头和下拉菜单顶部的一些添加空间,当您将鼠标悬停在其上时会变为灰色。我不确定为什么会这样,但我想删除它并让下拉菜单的第一个选项卡与父选项卡齐平。

任何想法如何解决这个问题?

这是CSS样式表:

/*Keeps vertical scrollbar present to prevent page shifting*/
html { min-height: 100%; margin-bottom: 1px; }

body {
    font-family: "Helvetica Neue", sans-serif;
    background: #FFFFFF;
    text-align: center;
    width: 100%;
    overflow-x:auto;
}


#menu{
    width: 800px;
    background: #FFFFFF;
    padding:0px;
}

#main {

    width: 800px;
    height: 100%;
    margin-top:10px;
    text-align: left;
    padding:0px;
    overflow: hidden;
}

#innerLeft {

    float: left;
    width: 590px;
    height: 100%;
    background: white;
    padding: 5px;
    padding-bottom: 50px;
    text-align: left;
    overflow: hidden;

}

#innerRight {   

    float: left;
    width: 170px;
    height: 100%;
    background: white;
    border-left:thin solid grey;
    padding: 5px;
    padding-bottom: 50px;
    text-align: left;
    margin-left: 10px;
    font-size: 10pt;
    overflow: hidden;

}

ul#nav,ul#nav li{list-style-type:none;margin:0;padding:0}

ul#nav{margin-left: 0px;width:800px}

ul#nav li{float:left;margin-right: 3px;text-align: center;list-style: none outside none;position:relative;}

ul#nav a{float:left;width: 6em;padding: 5px 0;background: #B0C4DE;text-decoration:none;color: #000}

ul#nav a:hover{background: #E7F1F8;color: #000}

ul#nav li.activelink a,ul#nav li.activelink a:hover{background: #000000;color: #FFFFFF}

ul#list,ul#list li{list-style-type:none;margin-left:0px;margin-top:8px;padding:0}

ul#pub,ul#pub li{list-style-type:none;margin-left:0px;margin-top:12px;padding:0}  

/* ------- Dropdown Menu-------- */
#nav li:hover {background:#777;}

#nav ul {
position:absolute;
left:-999em;
top:1em;
list-style:none;
}

#nav li:hover ul {
display: inline-block;
left: -40px;
position: absolute;

}


/* ------- calendar specific styles -------- */

a.cal:link {text-decoration:underline;color:blue;display:block;width:100%;height:100%;background:white;}
a.cal:visited {text-decoration:underline;color:blue;display:block;width:100%;height:100%;background:white;}
a.cal:hover {text-decoration:underline;color:black;display:block;width:100%;height:100%;background:#DDDDDD;}
a.cal:active {text-decoration:underline;color:blue;display:block;width:100%;height:100%;background:white;}

这是菜单的代码:

<div id="menu">
<a href="./"><img src="logo/SF_logo.gif" style="border-style: none" alt="Susanne Ferber - Cognitive Neuroscience Lab"></a>
</div>
<div id="main">
    <ul id="nav">
    <li id="home" <?php if (curPageName()=="index.php") { echo "class='activelink'"; } ?>><a href="index.php">Personal</a></li>
    <li id="lab" <?php if (curPageName()=="lab.php") { echo "class='activelink'"; } ?>><a href="lab.php">Lab</a></li>
    <li id="publications" <?php if (curPageName()=="publications.php") { echo "class='activelink'"; } ?>><a href="publications.php">Publications</a></li>
    <li id="teaching" <?php if (curPageName()=="teaching.php") { echo "class='activelink'"; } ?>><a href="teaching.php">Teaching</a></li>
    <li id="people" <?php if (curPageName()=="people.php") { echo "class='activelink'"; } ?>><a href="people.php">People</a></li>
    <li id="Resources" <?php if (curPageName()=="resources.html") { echo "class='activelink'"; } ?>><a href="facilities.php">Resources</a>
              <ul>                
                <li>  <?php ?>><a href="facilities.php">Facilities</a></li>            
               </ul></li>


</ul>
    <div id="innerLeft">

非常感谢!

3 个答案:

答案 0 :(得分:1)

你有额外的&#34;&gt;&#34;在这个li之后,这个开放的php标签

 <li>  <?php ?>><a href="facilities.php">Facilities</a></li>            

答案 1 :(得分:1)

您输入了额外的&#34;&gt;&#34;

<li>  <?php ?>><a href="facilities.php">Facilities</a></li>

应该是

<li>  <?php ?><a href="facilities.php">Facilities</a></li>

每行都有。

答案 2 :(得分:0)

您有?>><a,导致>

<div id="menu">
<a href="./"><img src="logo/SF_logo.gif" style="border-style: none" alt="Susanne Ferber - Cognitive Neuroscience Lab"></a>
</div>
<div id="main">
    <ul id="nav">
    <li id="home" <?php if (curPageName()=="index.php") { echo "class='activelink'"; } ?><a href="index.php">Personal</a></li>
    <li id="lab" <?php if (curPageName()=="lab.php") { echo "class='activelink'"; } ?><a href="lab.php">Lab</a></li>
    <li id="publications" <?php if (curPageName()=="publications.php") { echo "class='activelink'"; } ?><a href="publications.php">Publications</a></li>
    <li id="teaching" <?php if (curPageName()=="teaching.php") { echo "class='activelink'"; } ?><a href="teaching.php">Teaching</a></li>
    <li id="people" <?php if (curPageName()=="people.php") { echo "class='activelink'"; } ?><a href="people.php">People</a></li>
    <li id="Resources" <?php if (curPageName()=="resources.html") { echo "class='activelink'"; } ?><a href="facilities.php">Resources</a>
              <ul>                
                <li>  <?php ?><a href="facilities.php">Facilities</a></li>            
               </ul></li>


</ul>
    <div id="innerLeft">