[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 162
  • Last Modified:

nth-child not working out for me!

I want to remove the right margin from every 5th image on this page when width is 1035px+:


I'm using :nth-child(5n+5) to do it and the third is being targeted instead of the 5th. Is there something overriding this or am I doing it wrong?

Alicia St Rose
Alicia St Rose
1 Solution
That is not the nth-child as you have other elements in between - use

.fancy-thumb:nth-of-type(5n) {

Open in new window

Alicia St RoseOwner & Principle Developer/DesignerAuthor Commented:
Thanks Gary!!
You just saved my bacon!

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now