如何选择第三个链接以删除右边框?前三个是文本链接,我想从最后一个文本链接中删除右边框。最后两个是按钮。我也不想要按钮之间或按钮末尾的边框。我无法相信我在这方面遇到了多大的麻烦。它可能是一个简单的解决方案,但它让我永远为浏览器弄清楚它。谢谢。
Javascript
<script language="javascript" type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script language="javascript">
$(document).ready(function() {
$("ul.subnavigation li:nth-child(3)").addClass("last-child");
});
</script>
HTML
<ul class="subnavigation">
<li><a href="$sign_in_url" id="Program" rel="nofollow" ></a>Program </li>
<li><a href="$sign_in_url" id="About" rel="nofollow" >About </a> </li>
<li><a href="$sign_in_url" id="faq" rel="nofollow" >How to/FAQs</a> </li>
<li><a href="$sign_in_url" id="register" rel="nofollow" class="btn_register hide-text">Register</a> </li>
<li><a href="$sign_in_url" id="signin" rel="nofollow" class="btn_signin hide-text">Sign in</a></li></ul>
CSS
ul.subnavigation {
font-family:Arial, sans-serif;
font-weight:bold;
font-size:16px;
color:#333333;
list-style:none;
}
.subnavigation li{
display:inline;
border-right:1px solid #ccc;
}
.subnavigation li:last-child{
display:inline;
border-right:0px;
}
.last-child {border:none;}
.subnavigation li a {
text-decoration:none;
padding:0 10px 0 10px;
line-height:18px;
}
.subnavigation li a:hover {
color:#2274ac;
}
.subnavigation a.btn_register {
background:url(../images/nt_btn-register.png) no-repeat;
width:66px;
height:23px;
display:inline-block;
margin:0 5px 0 0;
float:right;
text-indent:-999px;
}
.subnavigation a.btn_signin {
background:url(../images/nt_btn-signin.png) no-repeat;
width:56px;
height:23px;
display:inline-block;
margin:0 10px 0 5px;
float:right;
text-indent:-999px;
}
.hide-text {
text-indent: 100%;
white-space: nowrap;
overflow: hidden;
}