How can I select the last nav item in the navbar?

mpatsia
Shopify Partner
85 0 8

Hello, i tried to select the last nav item in the navbar without any success because the following code targets the entire navbar, does anyone knows what i have made wrong? i grab the selector using the devtools

 

The code

```

div.-mx-4.flex.justify-center.items-center.sf-no-scroll-bar.sf-menu-wrapper__desktop > :nth-child(6)

```

 

https://hairmony.gr

 

Screenshot 2023-09-21 at 13.04.33.png

Replies 3 (3)

GetJuicy
Shopify Partner
11 1 5

Are you trying to target with CSS? I would recommend using the :last-child selector rather than :nth-child inside the ul tag

 

https://css-tricks.com/almanac/selectors/l/last-child/

 

Let me know if that helps

 

GetJuicy
https://getjuicy.co.uk
Contact us for further Shopify support and help
-If this solution is worked, then please Like this and Mark this as accepted solution!

DelightCart
Shopify Partner
1239 82 157

@mpatsia What exactly you want to achieve? 

Delight Cart - It's time to turn your visitors into loyal shoppers! 

Delight Loyalty - Increase repeat sales quickly and build lifelong customers loyalty.
mpatsia
Shopify Partner
85 0 8

Hello, i want to make the last nav element blue.