gridgarden icon indicating copy to clipboard operation
gridgarden copied to clipboard

Level 26. Making 5 rows.

Open asaltenis opened this issue 7 years ago • 41 comments

The challange description says, that I should make 5 rows using grid-template-rows.

grid-template-rows works much the same as grid-template-columns.

Use grid-template-rows to water all but the top 50 pixels of your garden. Note that the water is set to fill only your 5th row, so you'll need to create 5 rows in total.

I made it, but it doesn't work. Here is my line of code: grid-template-rows: repeat(4, 10px) 1fr;

And it shows, how, I think, it should look like:

paveikslas

asaltenis avatar Jan 31 '18 14:01 asaltenis

You almost have the solution except you've left 40px of space up top instead of 50px.

thomaspark avatar Jan 31 '18 14:01 thomaspark

This issue highlights the needs for hints in the game. I couldn't figure out the answer to this level either until I found this issue.

DarrellBrogdon avatar Feb 15 '18 17:02 DarrellBrogdon

repeat(4, 12.5px) 1fr; thank me later

yofriadi avatar Feb 16 '18 03:02 yofriadi

You could also do: grid-template-rows: 12.5px 12.5px 12.5px 12.5px;

SpyrosKo avatar Mar 14 '18 20:03 SpyrosKo

grid-template-rows: 50px 0 0 0; works

cnscorpions avatar Apr 17 '18 05:04 cnscorpions

Why is this solution not accepted?

 grid-template-rows: 50px 1fr 1fr 1fr 100%;

koenknol avatar Jun 27 '18 13:06 koenknol

I kind of agree that this one was a bit vague. I solved it with grid-template-rows: 50px 0 0 0 100%; but it wasn't accepted.

Awesome project by the way, thanks for making this Thomas!

JoeRoddy avatar Jun 03 '19 17:06 JoeRoddy

it has to be an error because it says the water should only fill the 5th row

korenes avatar Aug 09 '19 02:08 korenes

grid-template-rows: 50px 0 0 0 1fr;

artlili avatar Aug 28 '19 17:08 artlili

I don't understand after spending hours trying to find a solution, I came up with this: grid-template-rows: repeat(2, 0%)25px 25px;

jothamardel avatar Sep 07 '19 02:09 jothamardel

@yofriadi how you get that? did you make some calculation? any explain? o just testing the mesure?

repeat(4, 12.5px) 1fr; thank me later

rabindranathforcast avatar Sep 24 '19 14:09 rabindranathforcast

@rabindranathforcast

4 x 12.5px = 50px (takes care of the 50px gap at the top and uses 4 rows) 1fr (fills the rest of the space and uses 1 row) --> the above equates to 5 rows.

I was stuck too on this one. The explanation is a bit cryptic but now I see the solution, it's clearer.

cazroam avatar Mar 04 '20 03:03 cazroam

this is my ansower: grid-template-rows: repeat(4,12.5px) 1fr;

herzorf avatar Apr 02 '20 12:04 herzorf

This can be handled with various combinations This is my answer: grid-template-rows: 20px repeat(3, 10px) 1fr; 20px for first row + 10px for next 3 row = 50 px for 1st four rows 1fr will take remaining space

kumar-vipin avatar Apr 03 '20 07:04 kumar-vipin

repeat(4, 12.5px) 1fr; thank me later

Thanks :)

haroldao avatar Jul 25 '20 17:07 haroldao

Mine was : grid-template-rows: 50px 0 0 0 :)

ValiNicula avatar May 11 '21 13:05 ValiNicula

However, 1fr is not even needed at the end. It is solved with:

grid-template-rows: repeat(4, 12.5px);

interglobalmedia avatar May 23 '21 16:05 interglobalmedia

I think the difficulty lies here:

you'll need to create 5 rows in total.

One must interpret the question properly (5 rows are needed). Then the answer is straightforward.

50px 0 0 0 1fr

Which means:

1st column: 50px 2nd: 0px 3rd: 0px 4th: 0px 5th: 1fr (take all the remaining space)

The water is set to fill the fifth column, so... All the carrots in the 5th column and the water filling this same column

juanluischaurant avatar Jun 21 '21 16:06 juanluischaurant

the answer is grid-template-rows:repeat(4, 12.5px) 1fr

BorisGaliano avatar Dec 01 '21 15:12 BorisGaliano

Also: grid-template-rows: 50px repeat(3, 0) 1fr;

Klemart3D avatar Dec 28 '21 11:12 Klemart3D

I just did this exercise and ran into the same problem. I came here and found the solution. grid-template-rows: repeat(4, 12.5px) 1fr; It is very strange, because supposedly it is as they say in another comment. But I also accept this. (? grid-template-rows: 12.5px 12.5px 12.5px 12.5px;

perman03 avatar Feb 16 '22 19:02 perman03

The challange description says, that I should make 5 rows using grid-template-rows.

grid-template-rows works much the same as grid-template-columns. Use grid-template-rows to water all but the top 50 pixels of your garden. Note that the water is set to fill only your 5th row, so you'll need to create 5 rows in total.

I made it, but it doesn't work. Here is my line of code: grid-template-rows: repeat(4, 10px) 1fr;

And it shows, how, I think, it should look like:

paveikslas

image

Umang-Vadadoriya avatar Mar 22 '22 05:03 Umang-Vadadoriya

my answer --- grid-template-rows: 50px repeat(3, 0) auto;

MatataLeon avatar Jun 16 '22 23:06 MatataLeon

grid-template-rows: 12.5px 12.5px 12.5px 12.5px 1fr; This also works

Alhajideen avatar Aug 18 '22 16:08 Alhajideen

This also works grid-template-rows: 50px 0 0 0;

jdx-code avatar Nov 15 '22 17:11 jdx-code

I think the difficulty lies here:

you'll need to create 5 rows in total.

One must interpret the question properly (5 rows are needed). Then the answer is straightforward.

50px 0 0 0 1fr

Which means:

1st column: 50px 2nd: 0px 3rd: 0px 4th: 0px 5th: 1fr (take all the remaining space)

The water is set to fill the fifth column, so... All the carrots in the 5th column and the water filling this same column

It's a great answer. but I noticed it also works without the 1fr in the end.

jdx-code avatar Nov 15 '22 17:11 jdx-code

I think the difficulty lies here: you'll need to create 5 rows in total. One must interpret the question properly (5 rows are needed). Then the answer is straightforward. 50px 0 0 0 1fr Which means: 1st column: 50px 2nd: 0px 3rd: 0px 4th: 0px 5th: 1fr (take all the remaining space) The water is set to fill the fifth column, so... All the carrots in the 5th column and the water filling this same column

It's a great answer. but I noticed it also works without the 1fr in the end.

Great catch!

juanluischaurant avatar Nov 18 '22 15:11 juanluischaurant

grid-template-rows: 50px repeat(3, 0px);

watarikai96 avatar Feb 08 '23 16:02 watarikai96

There need to be 5 rows - this is defacto.

So, the first "area" is to be of 50px.

The last area will be 1fr to water the whole carrot row length.

The first unwatered 50px can be done in various ways, as long as it takes 4 rows of any size, since it excludes the last area of 1fr as mentioned above.

Solution: grid-template-rows: repeat(2, 0%) 25px 25px 1fr; grid-template-rows: repeat(2, 0px) repeat(2, 25px) 1fr;

:))

Thaleia avatar Mar 02 '23 10:03 Thaleia

Here's the best possible answer:

grid-template-rows: repeat(3, 10px) 20px 1fr;

AbhishekAnand2 avatar Jun 25 '23 19:06 AbhishekAnand2