- This topic is empty.
Viewing 11 posts - 1 through 11 (of 11 total)
Viewing 11 posts - 1 through 11 (of 11 total)
- The forum ‘CSS’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
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?
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.
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
3n+1 does quite do it unfortunately.
I think it would take more than one nth-of-type
statements and they may be overlapping
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?
Damn…didn’t know it would be that easy.
:)
Sometimes I can’t see the wood for the trees..
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?–
Oh, and another one: how to put it back to odd or even, when 100% width of this blocks?
Safari doesnt “drop” these blocks on the next line. In my example http://cssdeck.com/labs/wmptd2wb
Version is 5.1.7 on Win7
upd
oh, I see its not the very last one… ok, thanks, thats my trouble.
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.