HTML & CSS · Junior · Question 32 of 75

What does grid-template-columns: repeat(3, 1fr) define?

Explanation

repeat(3, 1fr) is the same as 1fr 1fr 1fr. The fr unit is a fraction of the grid container's free space. Rows are defined with grid-template-rows. Caveat: 1fr means minmax(auto, 1fr) by default, so long content can stretch a column.

Further reading

Problem with a question

HTML & CSS · Junior · question 32

Test yourself

Take the HTML & CSS · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz