我有一個border-bottom屬性的問題。我希望我的邊框底部從80px高度的li元素的底部到頂部。當我嘗試使用border-top時,它會將我的「header nav ul li a」元素80px移動到底部。任何人有想法?導航菜單上的CSS border-bottom懸停
<section class="intro">
<header>
<div class="wrapper">
<nav>
<ul>
<li class="nav_home"><a href="#" onclick="return false;">Home</a></li>
<li class="nav_folio"><a href="#" onclick="return false;">Portfolio</a></li>
<li class="nav_about"><a href="#" onclick="return false;">About</a></li>
<li class="nav_contact"><a href="#" onclick="return false;">Contact</a></li>
</ul><!-- end nav-menu ul !-->
</nav>
</div>
</header>
</section>
.wrapper {
width: 1180px;
margin: 0 auto;
position: relative;
}
.intro {
width: 100%;
height: 100%;
background: url(../images/banner.jpg) no-repeat;
background-position: center center;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
header {
top: 0;
position: fixed;
left: 0;
right: 0;
width: 100%;
height: 80px;
color: #aaa;
text-align: center;
background: transparent;
border-bottom: 3px solid rgba(72, 191, 114, 1);
z-index: 99;
}
header nav {
float: right;
}
header nav ul {
list-style: none;
float: left;
}
header nav ul li {
position: absolute;
float: left;
margin-left: 5px;
width: 120px;
border-bottom: 0px solid transparent;
-webkit-transition: all 0.4s ease-in-out;
-moz-transition: all 0.4s ease-in-out;
-ms-transition: all 0.4s ease-in-out;
-o-transition: all 0.4s ease-in-out;
transition: all 0.4s ease-in-out;
height: 80px;
line-height: 80px;
}
header nav ul li a {
font-size: 1.2em;
text-transform: uppercase;
text-decoration: none;
text-align: center;
color: #fff;
outline: none;
}
header nav ul li:hover {
border-bottom: 80px solid #48bf72;
cursor: pointer;
}
我不明白你的問題。有什麼問題?你想要的確切結果是什麼或者你不想要的結果是什麼? – chiapa