How to make CSS Grid items take up remaining space?

前端 未结 6 2076
深忆病人
深忆病人 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

    Just use width: 100% and height: 100% in the CSS class of the item you want to fill the grid. Join a max-width property and a max-height property if you don't want a grid item inside a grid container to grow more than some size.

提交回复
热议问题