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

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -