css3 - CSS Grid—optional row at the top -
i stumbling css grids. right have such setup:
.container { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: minmax(100px, auto); grid-template-areas: "msg msg msg msg" "left left right right" "left left right right" "footer footer footer footer"; }
and working quite well. have first row optional, since there not message display. right now, space left blank, kind of expected.
is way that, add class container, if message there , change to:
.container { /*stuff above*/ grid-template-areas: "left left right right" "left left right right" "footer footer footer footer"; } .container.msg { grid-template-areas: "msg msg msg msg" "left left right right" "left left right right" "footer footer footer footer"; }
or can tell grid hide empty areas?
Comments
Post a Comment