Kevin Powell - CommunityKP-C
Kevin Powell - Communityβ€’3y agoβ€’
6 replies
Igor Verve

:last-child and :not pseudo classes together

I have a bunch of list items inside my <ul> all of which have class of "level0 level-top parent". However, the last 2 list items have an additional class called "mobile-nav-only" as well as "level0 level-top parent"

I want to add some CSS to the very last <li> with the class of "level0 level-top parent" BUT ONLY if that li does NOT have "mobile-nav-only". I believe I need to combine both :last-child and :not pseudo classes but I'm struggling to figure out the correct syntax.

Any help appreciated, thank you πŸ™‚

P.S. I cannot change the markup or add additional CSS classes
Was this page helpful?