How to make CSS Grid items take up remaining space?

前端 未结 6 2077
深忆病人
深忆病人 2020-12-03 10:16

I have a card built with CSS Grid layout. There might be an image to the left, some text to the right top and maybe a button or a link at the right bottom.

In the co

6条回答
  •  时光说笑
    2020-12-03 10:37

    When using grid, and you have grid template area used, and by chance you gave a particular area a width, you are left with a space grid does automatically. In this situation, let grid-template-columns be either min-content or max-content, so that it adjusts its position automatically.

提交回复
热议问题