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

Home Forums CSS [Solved] Alternating column widths at set intervals Reply To: [Solved] Alternating column widths at set intervals


That is absolutely spot on @gcyrillus!

Obviously I was getting the nth-child bit wrong. In your example I’m guess the:

li:nth-child(10n+1) {}

Resets the count so it doesn’t go off like my version did?

Another question, which I might need to create a new thread for: I’ve been asked if this layout would work scrolling horizontally rather that vertical.

I can’t really see how this would work without a lot of javascript calculation. As you’d need to know how many ‘rows’ would fit on the screen in each situation (screen width). Also I imagine an amount of the blocks would need to be grouped with a wrapper div – which would prevent the use of different layouts on mobile/tablet?

Thanks again @gcyrillus, that is beyond a massive help! :)