Click here to Skip to main content
15,910,981 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hello friends i am working on an asp:menu
it's items are like this

ItemA
ItemB
ItemC
ItemD
ItemE
ItemF
ItemG

i want to give a different color to menu item ItemA and ItemE from other menu items .
Is it possible using css.
Any help is really appreciated .Thanks in advance guys.
Posted

1 solution

try this...
CSS
<style type="text/css">
    .ItemA	
    {
   background-color:Orange;
   color:Black;
    }
    .ItemB	
    {
   background-color:White;
   color:Black;
    }
    .ItemC	
    {
   background-color:Green;
   color:Black;
    }
    </style>


JavaScript
<script type="text/javascript">
 $(function () {
            $("#Menu1 ul li").each(function () { //here menu1 is ur menu id
                $(this).addClass($(this).text());
            })
});
</script>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900