到目前为止,这是我所做的:
<html>
<head>
<style>
/* Tabs */
#navlist {
padding: 3px 0;
margin-left: 0;
border-bottom: 1px solid #778;
font: bold 12px Verdana,sans-serif;
/* WARNING: when using font-size/font-family instead of font,do not forget to set line-height:normal otherwise 1px more is shown
between tabs and their bottom line in IE8 and FF3.6 */
}
#navlist li {
list-style: none;
margin: 0;
display: inline;
}
#navlist li a {
padding: 3px 0.5em;
margin-left: 0px;
border: 1px solid #778;
border-bottom: none;
background: #DDE;
text-decoration: none;
}
#navlist li a:link { color: #448; }
#navlist li a:visited { color: #667; }
#navlist li a:hover {
color: #000;
background: #AAE;
border-color: #227;
}
#navlist li a#current {
background: white;
border-bottom: 1px solid white;
}
</style>
</head>
<body>
<div id="navcontainer">
<ul id="navlist">
<li><a id="current" href="#">Col1</a></li>
<li><a href="#">Col2</a></li>
<li><a href="#">Col3</a></li>
</ul>
</div>
</body>
</html>
并保存到http://jsbin.com/uvako3/2.感谢您的帮助
最佳答案
只需添加text-align:right;到#navlist CSS.
说明:您正在使列表项内联元素.这使得它们遵循适用于文本的一般规则.因此,只需设置文本对齐方式,即可指定内联元素的对齐位置.