grid-template-rows: 100px 200px 150px;
grid-template-rows: repeat(3, 1fr);
<style> .grid-container { display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); gap: 10px; } .grid-item { background-color: #f2f2f2; padding: 20px; } </style> <div class="grid-container"> <div class="grid-item">Grid Item 1</div> <div class="grid-item">Grid Item 2</div> <div class="grid-item">Grid Item 3</div> <div class="grid-item">Grid Item 4</div> <div class="grid-item">Grid Item 5</div> <div class="grid-item">Grid Item 6</div> <div class="grid-item">Grid Item 7</div> <div class="grid-item">Grid Item 8</div> <div class="grid-item">Grid Item 9</div> </div>
本文为翻滚的胖子原创文章,转载无需和我联系,但请注明来自猿教程iskeys.com