I would like to use the following to target the last link (a) of the last ul inside my div. So this is what came to mind:
#menu ul:last-child li a {
/*.....*/
}
I cant manually add a class to that element, and even if i wanted to do it dynamically i would still have to target the element the above way.
Any ideas why this is not working?
If you want the last link in the last ul (assuming the link is inside a li
-element), this is what you want:
#menu ul:last-child li:last-child a {
/*.....*/
}
#menu
returns the menu element. ul:last-child
returns the last ul
within #menu
li:last-child
returns the last li
within that ul
Haven't tried it, but i guess this would work.