The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS nth child issues

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • #38463

    Hello Tricksters!

    I’m experiencing some weirdness with nth child, and I have no idea what is causing it.

    Take a look at the site I’m working on:

    When you shrink the layout and the homepage grid responds – the nth child rules fall apart about half way down the page… This is fixed if I remove one of the board divs. I’m using even and odd as the selector. Am I doing this wrong?

    Any help is always appreciated. and the highest of internet fives if you can help me fix this :)


    Hi, iagainsti.

    It looks like your problem is here:

    @media screen and (max-width: 980px) {
    section.board-wrapper div:nth-child(3n+0) {
    margin-right: 4%;

    It also looks like that the following is overriding your nth-child(even) selector:

    wrapper div:nth-child(2n+2) {
    margin-right: 0;

    It looks like you are making use of the nth-child selector a few to mant times.

    I hope I have helped!!

    If I wasn’t at work, I would try helping you some more!



    That was it. But I think I need 2 declarations there. I just changed them to even and odd and it works just fine now.
    Forgot your super internet high-five! Thanks!

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘CSS’ is closed to new topics and replies.