Monday, July 30, 2012

Change Last child element color/border

1. Add below JavaScript/CSS in  header section 



<style>
.clear-right{
color:red;
}
</style>


<script src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript">
 $(document).ready(function () {
$(".menu-item li:last-child").addClass("clear-right"); 
$
})
</script>



2. Add below html code or class in body section 




<ul class="menu-item">
    <li>item</li>
    <li>item</li>
    <li>item</li>
</ul>
 

No comments:

Post a Comment