Which CSS pseudo-class would allow you to target only the last list item in an unordered list?

  • :last-child
  • :last-item
  • :nth-last-child
  • :only-child
To target the last list item in an unordered list, you should use the :last-child pseudo-class. This will select the last child element of its parent, which in this case is the last list item in the unordered list.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *