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
Post a Comment