Re:Learn CSS Grid with a virtual garden game
by cudder on Monday June 03, 2024 @01:13AM
(#40559532)
Pretty fun! I got stuck at level 26, my solution looks visually correct but the next button won't activate:
[ Parent
| on HN ]
Re:Learn CSS Grid with a virtual garden game
by friendzis on Monday June 03, 2024 @03:35AM
(#40560221)
Neat (or not, depending on your position) thing about grids is that they allow for zero-size areas.
With your approach you need 4 rows with the size of 50px/4=12.5px:
`grid-template-rows: repeat(4, 12.5px) 1fr;`
However, you can also "size" first (or any other "nice" number) of rows and insert zero-sized fluff areas:
`grid-template-rows: 50px repeat(3, 0px) 1fr;`
You are watering everything except for top 40 pixels. You need to water everything except for top 50 pixels.
Re:Learn CSS Grid with a virtual garden game
by p0seidon on Monday June 03, 2024 @02:46AM
(#40559984)
Gone are the beautiful days of <table> layouts.
Re:Learn CSS Grid with a virtual garden game
by aniforprez on Monday June 03, 2024 @05:57AM
(#40561026)
And I'm so thankful. Table layouts are horribly restrictive and opinionated with all sorts of arcane under-the-hood rendering rules making simple things like fixing the width of your columns not work at all. Grid is better except obviously if you're rendering an actual table
12.5px