@aniakubow: Here is the code: .parent { width: 100%; display: grid; grid-template-columns: repeat(auto-fit, 300px); gap: 20px; justify-content: center; } .child { width: 300px; height: 400px; }

Code with Ania Kubow
Code with Ania Kubow
Open In TikTok:
Region: AE
Tuesday 14 January 2025 14:18:16 GMT
71244
4124
53
399

Music

Download

Comments

jc_mayo
papajay :
flex flex wrap
2025-01-14 21:57:45
34
crustamet
crustamet :
so what will happen if your device has only 288 px ? :))
2025-01-14 16:21:11
3
lore_lugano
Grey Falcon :
what's difference with just using float:left?
2025-01-16 08:24:51
0
000ict
000 :
awesome tip. I am trying to fire a page refresh on each change of horizontal tile count. Do you have experience with controlling location.reload()? please please please 🥰
2025-01-15 02:28:04
0
daemon_the_first
Daemon_the_first :
For some reasons I’ve always preferred flexbox over grid system but I love grid. Thanks. You should have made this video downloadable btw
2025-01-15 16:04:48
4
ser.lifts
ser.lifts :
You can also achieve this like in old times: parent with text-align:center and children with display:inline-block, width and some margin. Done
2025-01-16 21:44:19
1
twisted4all
twisted4all. :
what if all my child has different height? how to make them fit vertically tight? is that possible?
2025-01-15 14:34:26
1
nuel_lee1
Ema🪙🇳🇬 :
most of us just use flex
2025-01-25 10:11:17
0
To see more videos from user @aniakubow, please go to the Tikwm homepage.

Other Videos


About