这就是我得到的。我需要在菜单选项之间增加分隔符(|)的高度。我该怎么做才能占用整个标题区域?
HTML:
<header>
<img src="/images/logo.png" height="50px" id="front" />
<nav>
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">About</a></li>
<li class="last"><a href="#">Contact</a></li>
</ul>
</nav>
<div id="second_line"></div>
</header>
CSS:
body {
margin: 0;
}
header {
background-color: #009000;
height: auto;
position: relative;
}
#front {
margin-left: 20px;
margin-top: 20px;
}
nav {
float: left;
margin-top: 30px;
}
ul {
margin: 0;
padding: 0;
float: left;
}
ul li {
list-style-type: none;
float: left;
border-right: 2px solid black;
padding-right: 5px;
padding-left: 5px;
}
ul li.last {
border-right: 0px;
}
#second_line {
margin-top:10px;
height:3px;
background-color: #FECE2C;
}
谢谢!
答案 0 :(得分:1)
ul li {
list-style-type: none;
float: left;
border-right: 2px solid black;
padding-right: 5px;
padding-left: 5px;
**line-height:30px;**
}