我在 div 的结束标记之前有一个水平无序列表。名单被放置在边界上。现在我尝试添加border-bottom: 1.5px solid #b9b7b7;
到 div,列表只是从边界向上移动,好像 div 底部边框和列表之间有一个填充,但我的 css 中没有这样的填充。我该怎么做才能将底部边框添加到父 div 并仍然将最后一个子元素放置在父 div 的底部边界?
编辑: html
<div id="banner"><img src="images/banner.gif" width="450px" height="80px" alt="parul library" />
<div id="navigation_panel">
<ul id="buttonlist">
<li class="navbuttons">Home</li>
<li class="navbuttons">About us</li>
<li class="navbuttons">New Releases</li>
<li class="navbuttons">Catalogue</li>
<li class="navbuttons">Locate us</li>
<li class="navbuttons">Contact us</li>
</ul>
</div>
</div>
CSS:
.navbuttons{
display:inline-block;
padding-left:15px;
padding-right:15px;
padding-top:5px;
padding-bottom:5px;
height:30px;
font-family:"Palatino Linotype", "Book Antiqua", Palatino, serif;
font-weight:bold;
font-size:18px;
color:#FFF;
background: rgb(110,156,183); /* Old browsers */
background: -moz-linear-gradient(top, rgba(181,221,244,1) 0%, rgba(110,156,183,1) 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(181,221,244,1)), color-stop(100%,rgba(110,156,183,1))); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, rgba(181,221,244,1) 0%,rgba(110,156,183,1)) 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, rgba(181,221,244,1) 0%,rgba(110,156,183,1) 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, rgba(181,221,244,1) 0%,rgba(110,156,183,1) 100%); /* IE10+ */
background: linear-gradient(to bottom, rgba(181,221,244,1) 0%,rgba(110,156,183,1) 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#b5ddf4', endColorstr='#6e9cb7',GradientType=0 ); /* IE6-9 */
}
#banner{
margin-top:0;
border-bottom: 1.5px solid #b9b7b7;
}