
On this example, the static html code for menu use a dotted border on right for each menu item. The last menu item will have a special “li” class where the border is set to “none”, to can have the dotted separator just between two menu items.
[code='text']
[/code]
Ok, but this part of your code will look different when you are integrating it in WordPress for instance. Example:
[code='php']
[/code]
Now, the last menu item will have also the separator. If with “li” tag you can defines each item in the list, the “ul” tag defines the list. On WordPress, in this case, you cannot style a single item list without a small jQuery code inserted in your header.php
[code='js']
$(document).ready(function() {
$("#menu li:last").addClass("last");
});
[/code]
Now the menu look ok and on WordPress. You can apply in same way and a class for “first” list item.








[User Link:How to add a CSS class to your WordPress lists with jQuery] | Tips for Designers and Developers | tripwire magazine
wp-popular.com » Blog Archive » How to add a CSS class to your WordPress lists with jQuery | reADactor
200 Fresh and Useful Articles for Designers and Developers | tripwire magazine
How to add a CSS class to your WordPress lists with jQuery
CSS Brigit | How to add a CSS class to your WordPress lists with jQuery
200+ Useful Resources for Graphics Designers and Web Developers | Graphics & Design | Online News & Entertainment
WordPress is a powerful content management system but it doesn’t always do what you want it to do which is why help such as this is so invaluable. Many thanks.
Thanks a lot for putting this code out there guys. I was searching for a way to do something very similar on my site and now I know that I can implement it. Cheers.
Adding this code will definitely make my wordpress lists more versatile. I will try this out for my own site. I’ll let you know soon if it works for me.
Fred Homes
Tucson architects
Nice article.
Just visit http://www.wordpressstop.com for lot of articles related to WordPress.
Keep Smiling.