php - Adding an arrow to link with children -


here's code of simpliest multilevel menu:

<nav>     <ul>         <li><a href="#">i 1st level link</a></li>         <li><a href="#">i 1st level link children , want have arrow next me (or different background)</a>             <ul>                 <li><a href="#">i 2nd level link</a></li>                 <li><a href="#">i 2nd level link children , want have arrow next me (or different background)</a>                 <ul>                     <li><a href="#">i 3nd level link</a></li>                     <li><a href="#">i 3nd level link</a></li>                 </ul>                 </li>             <li><a href="#">i 2nd level link</a></li>             </ul>         </li>         <li><a href="#">i 1st level link</a></li>         <li><a href="#">i 1st level link</a></li>     </ul> </nav> 

is there way of selecting links children , adding them different styling (background, list-style-type icons etc.)? menu dynamic giving ids or classes won't in case.

i'd love see in css3, if not possible - jquery or php ok. want cross-browser ready. @ moment don't know start?

thanks lot!

this seems work using jquery... can customize special class background image error or whatever want....

<script>     $(document).ready(function(){         $('ul + ul').each(function(){             $(this).prev().addclass('special');         });     }); </script> <style type="text/css">     .special {background-color: red;} </style> 

Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

aspxgridview - Devexpress grid - header filter does not work if column is initially hidden -

c# - How to execute a particular part of code asynchronously in a class -