摆脱导航栏中的边框与单独的ul

时间:2016-12-15 22:10:22

标签: html css

我希望摆脱" in between"导航栏的边框。 虽然我分配了课程,但我有很多小提琴和小节,它似乎干扰了我的导航栏。 这是一张照片应该是什么样子: enter image description here



    body{
    background-image: url("../Images/bg.jpg");
    color: white;
}
h1{
    font-family: sans-serif;
    font-size: 4em;
    
}
h2{
    height: 56px;
    font-family: sans-serif;
    text-align: center;
}
.white{
    color: white
}
.blue{
    color: #00bfff
}

li{
    display: block;
    border-style: solid;
    border-color: white;
    border-width: 1px;
    padding: 4px;
}
ul{
    border-style: solid;
    border-color: white;
    border-width: 1px;
    width: 100%;
    margin: 0px;
    padding: 0;
    font-family: sans-serif;
    
}
.small{
    width: 270px;
    float: left;
}
.red{
    background-color: #FF4500;
}
.orange{
    background-color: #FF8C00;
}
.yellow{
    background-color: #FFBF00;
}
.brown{
    background-color: #9C6E03;
}
.black{
    background-color: #0d1a00
}
img{
    width: 100%;
    height: 184px;
}
.zoom{
    width: 370px;
    height: 600px;
    font-size: 20px;
    float: left;
    background-image: url("../Images/bg.jpg");
    margin-top: -50px;
}
.menuUl{
    list-style-type: none;
    margin: 0;
    padding: 0;
    overflow: hidden
}
.menuLi{
    float: left;
}
li a {
    display: block;
    color: white;
    text-align: center;
    padding: 14px 16px;
    text-decoration: none;
}
li a:hover {
    background-color: firebrick;
    border-radius: 5px:
}




注意:我知道href链接还没有。

JS小提琴: https://jsfiddle.net/rsgq3v5e/

3 个答案:

答案 0 :(得分:1)



html, body {
  background-color:#222;
}

.menuUl {
  list-style-type: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border-top: solid 1px #EEE;
  border-bottom: solid 1px #EEE;
}
.menuLi {
  float: left;
}
li a {
  display: block;
  color: white;
  text-align: center;
  padding: 14px 16px;
  text-decoration: none;  
  border-radius: 10px;
}
li a:hover {
  background-color: firebrick;
}

li a.active {
  background-color: firebrick;
}

<ul class="menuUl">
  <li class="menuLi"><a class="active" href="EindOpdracht.html">COURSES</a>
  </li>
  <li class="menuLi"><a href="">INFO DAY</a>
  </li>
  <li class="menuLi"><a href="">LOCATIONS</a>
  </li>
</ul>
&#13;
&#13;
&#13;

答案 1 :(得分:1)

&#13;
&#13;
prefetch_related
&#13;
html, body {
  background-color:#222;
}

.menuUl {
  list-style-type: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border-top:2px solid #fff;
  border-bottom:2px solid #fff;
}
.menuLi {
  float: left;
  
}
li a {
  border-radius:5px;
  display: block;
  color: white;
  text-align: center;
  padding: 14px 16px;
  text-decoration: none;
}
li a:hover {
  background-color: firebrick;
}
&#13;
&#13;
&#13;

答案 2 :(得分:0)

.menuUl {
list-style-type: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: #424242;
    border-top: 2px solid white;
    border-bottom: 2px solid white;

}
.menuLi {
  float: left;
}
li a {
  display: block;
  color: white;
  text-align: center;
  padding: 14px 16px;
  text-decoration: none;
}
li a:hover {
  background-color: #e65e0f;
  border-radius: 7px;
}