Forums

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

Home Forums CSS CSS stripes white/grey + grey/white

  • This topic is empty.
Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #174212
    Romchick
    Participant

    Hi there!
    I have a goal:

    To make 2 blocks in row to be “white / grey” and the next row is “grey / white”
    Cant make it when its 45% width, but its ok as its has to be, when 100% width.
    My pain is here: http://cssdeck.com/labs/wmptd2wb.

    How can I fix it?

    #174218
    Alan C
    Participant

    Well if I understand what you are asking. You could do an :nth-child(3n+1) selector. So set all of the blocks to grey originally, then use that rule to add in the white.

    But if I’m wrong I will need more detail.

    #174220
    Romchick
    Participant

    No. Thats not it. If blocks are more then 4, then “bad things” are happening. So my needs are like chess board (black/white/black/white), but when in row only 2 blocks. See again http://cssdeck.com/labs/wmptd2wb

    #174223
    Paulie_D
    Member

    3n+1 does quite do it unfortunately.

    I think it would take more than one nth-of-type statements and they may be overlapping

    #174224
    Romchick
    Participant

    Well, just as I thought… may be in future there will be a chess mode 8)

    By the way, is there any possibility to force Safari wrap this blocks, as it does Chrome or any other “normal” browsers?

    #174232
    Paulie_D
    Member

    Damn…didn’t know it would be that easy.

    :)

    Sometimes I can’t see the wood for the trees..

    #174233
    Romchick
    Participant

    Thanks alot, guy… never made it above 3 (3n+… etc). And what about other small question?

    –is there any possibility to force Safari wrap this blocks, as it does Chrome or any other “normal” browsers?–

    #174238
    Romchick
    Participant

    Oh, and another one: how to put it back to odd or even, when 100% width of this blocks?

    #174240
    Romchick
    Participant

    Safari doesnt “drop” these blocks on the next line. In my example http://cssdeck.com/labs/wmptd2wb

    #174242
    Romchick
    Participant

    Version is 5.1.7 on Win7

    upd

    oh, I see its not the very last one… ok, thanks, thats my trouble.

    #174245
    Romchick
    Participant

    if you will be able to fix it I’ll dring a cup of cold beer for you! *) cuz many of my pages have this trouble.

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