Two Columns Grid Design

hey anyone knows how to achieve this design using css grid? I've been trying all day to figure out how to recreate this kind of 2 columns staircase but without success. Thank you
15 Replies
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
grandpaK420
grandpaK420OP2y ago
yes I already did that but I don't want the divs inside the 2 columns to be right next to each other there is a little offset
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
grandpaK420
grandpaK420OP2y ago
column-gap is adding to both columns
needmorewood
needmorewood2y ago
add only bottom gap to the left side and top gap to the right side if that is a thing or margintop and margin bottom
grandpaK420
grandpaK420OP2y ago
I'll see if it's doable
needmorewood
needmorewood2y ago
otherwise you can look into a "masonry" plugin or tutorial its sort of what theses different off standard grids are built on
BarisP
BarisP2y ago
Select the every 2n'th child of the parent and give them margin-top
needmorewood
needmorewood2y ago
npm
react-responsive-masonry
React responsive masonry component built with css flexbox. Latest version: 2.1.6, last published: 2 months ago. Start using react-responsive-masonry in your project by running npm i react-responsive-masonry. There are 11 other projects in the npm registry using react-responsive-masonry.
needmorewood
needmorewood2y ago
not vouching for that library but something like this can help you
BarisP
BarisP2y ago
div:nth-child(2n)
grandpaK420
grandpaK420OP2y ago
yes I understand, thank you @needmorewood and @Barış-Pal !
BarisP
BarisP2y ago
as selector You're welcome, good lucky Giving margin to second child only, might work too, I haven't tested it
grandpaK420
grandpaK420OP2y ago
I had to add margin to every div on the 2nd column @Barış-Pal doesn't work for only the first child! Thank you for the solution
BarisP
BarisP2y ago
You're welcome 🙂
Want results from more Discord servers?
Add your server