我有一个下拉导航,想要反转最后一个孩子留在页面上。我怎样才能做到这一点?
/* Sub Menu */
/* Drop Down Box BKGD & STYLE*/
.menu ul {
z-index:8000;
position: absolute;
top: 45px;
left:0px;
opacity: 0;
background:url(../images/BKGDRepeat3_03.png);
-moz-box-shadow:0 3px 5px #666;
-webkit-box-shadow:0 3px 5px #666;
box-shadow: 0 3px 5px #666;
-webkit-border-radius: 5px 5px 5px 5px;
-moz-border-radius: 5px 5px5px 5px;
border-radius: 5px 5px5px 5px;
-webkit-transition: opacity .25s ease .1s;
-moz-transition: opacity .25s ease .1s;
-o-transition: opacity .25s ease .1s;
-ms-transition: opacity .25s ease .1s;
transition: opacity .25s ease .1s;
}
.menu ul:last-child {
color:#C00;
right:0px;
left:auto;
}
html
<div style="clear:both" id="nav_bar">
<ul class="menu">
<li><a href="index.php">Home</a></li>
<li><a href="about.php">one</a>
<ul>
<li><a href="#">One</a></li>
<li><a href="#">Two</a></li>
</ul>
</li>
<li><a href="#">Directory</a>
<ul>
<li><a href="#">One</a></li>
<li><a href="#">Two</a></li>
</ul>
</li>
<li><a href="#">Contact</a>
<ul>
<<li><a href="#">One</a></li>
<li><a href="#">Two</a></li>
</ul>
</li>
</ul> <!-- end .menu -->
</div>
这目前影响所有子菜单,而不仅仅是最后一个。