Who does minmax(0, 1fr) work for long elements while 1fr doesn't?

后端 未结 1 962
礼貌的吻别
礼貌的吻别 2020-11-22 06:11

So I have this grid:

+---------+------------------------------+---------+    
|  
|

- 1000 characters long |

| +-------
相关标签:
1条回答
  • 2020-11-22 06:36

    Because 1fr is equivalent to minmax(auto, 1fr), by default.

    When you use minmax(0, 1fr), that's something different than standalone 1fr.

    In the first case, the track cannot be smaller than the size of the grid item (min size is auto).

    In the second case, the track is free to resize to a 0 width/height.

    More details:

    • Reconsider the meaning of 1fr
    • Prevent grid area from expanding causing whole page to scroll
    0 讨论(0)
提交回复
热议问题