导航栏工作不正常?

时间:2016-03-15 22:04:06

标签: nav

所以我正在建立一个学校评估网站,我想知道为什么我的导航栏链接总是略低于实际的导航栏本身。如果有人能提供帮助,那就太棒了:)。

    ul {
  text-align: center;
  padding-left: 1px;
  top: -10px;
  list-style: none;
}

ul li {
  font-family: Arial;
  font-size: 15px;
  font-weight: bold;
  display: inline-block;
  margin-right: -4px;
  position: 0px;
  padding: 10px 89.5px;
  background-color: #6C2DC7;
  -webkit-transition: all 0.2s;
  -moz-transition: all 0.2s;
  transition: all 0.2s;

}
ul li:hover {
  background:  #8467D7;
  }

a:link {color:#FFFFFF;} /* unvisited link */
a:visited {color:#FFFFFF;} /* visited link */
a:hover {color:#FFFFFF;} /* mouse over link */
a:active {color:#FFFFFF;}  /* selected link */
a {
text-decoration: none;
}

This is what it looks like on my website.

1 个答案:

答案 0 :(得分:0)

如果你改变它,它将起作用:

你的style.css第75行

ul {
    text-align: center;
    top: 0px;
    list-style: none;
    margin-top: -5px;
}

你真的应该只为你的导航栏做这个而不是每个ul,所以你可以把它更改为下面的内容:尽管两种方式都可以使用:)

 #navigation ul {
        text-align: center;
        top: 0px;
        list-style: none;
        margin-top: -5px;
    }
相关问题