Can I make a CSS grid with dynamic number of rows or columns?

前端 未结 5 2063
猫巷女王i
猫巷女王i 2020-12-13 08:51

What I wanna do is to make a CSS grid with a dynamic number of cells. For the sake of simplicity, let\'s assume there will always be four cells per row. Can I specify a grid

5条回答
  •  时光说笑
    2020-12-13 09:09

    Simply use below code to generate grid columns automatically

    .container {
      display: grid;
      grid-auto-flow: column;
    }
    

提交回复
热议问题