Forums

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

Home Forums CSS nth-child seem doesnt select the element i choose

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #295806
    hira_47
    Participant

    hi all, it’s my 2nd posting here, this one about pseudo-class that doesn’t change the way I wanted

    I already put the same selector but it seems doesn’t select it, any help and suggestion would be very appreciated
    I’m trying to make 2 blog post on the website to be white and light and grey, to make them different to each other

    Hira.
    (ps: its been only 3 days since I start coding, so help its what I need.. and sorry for the bad English)
    here is the content code:

    (Edit: Using code instead, thank you again for the mod for the suggestion)
    https://codepen.io/Hira_47/pen/ExYRabz

    ps: I already change all the personal info, the rest are for example so the link won’t link to anywhere

    Hope anyone can help me in this
    Best regards,
    Hira.

    #295807
    Paulie_D
    Member

    Please make a demo in Codepen.io rather than posting HTML & CSS

    But you might want to review this

    https://stackoverflow.com/questions/5545649/can-i-combine-nth-child-or-nth-of-type-with-an-arbitrary-selector

    #295842
    hira_47
    Participant

    ive read it, but yet im still confused to make it work so the other “content” background is light gray

    #295847
    Paulie_D
    Member

    Basically, you can’t do `nth-of-class”…there is no such thing.

    You’d have to select the divs some other way.

    Wrap all your post content divs in a wrapper and then you can use nth-child

    https://codepen.io/Paulie-D/pen/MWgXPXW

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