我如何不必为网格 - 板块列编写20次自动

发布于 2025-02-01 11:52:15 字数 121 浏览 1 评论 0原文

嘿,我不确定我应该在哪里问这个问题,而是基本上是在蚀刻绘制素描和我的原始16x16网格上。我使用了显示:网格;和网格 - 板块柱,并撰写了16次自动。这确实做到了,但是我猜想当您有90x90的网格有任何技巧时,这不是要走的路吗?

Hey all not to sure where I should ask this question but basically Im working on Etch a Sketch and for my original 16x16 grid. I used display:grid; and grid-template-columns and wrote auto 16 times. This did the trick but Im guessing its not the way to go when you have a grid that 90x90 Any tips?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

紫罗兰の梦幻 2025-02-08 11:52:15

使用重复()函数:

grid-template-columns: repeat(90, 1fr);

也可用于网格 - 板条行

参考:

Use the repeat() function:

grid-template-columns: repeat(90, 1fr);

This can be used for grid-template-rows also.

References:

红玫瑰 2025-02-08 11:52:15

我认为这就是您要寻找的:

/*Creates 90 columns, each 150px in width*/
grid-template-columns: repeat(90, 150px); 
/*Creates 90 rows, each 150px in height*/
grid-template-rows: repeat(90, 150px);

I think this is what you are looking for:

/*Creates 90 columns, each 150px in width*/
grid-template-columns: repeat(90, 150px); 
/*Creates 90 rows, each 150px in height*/
grid-template-rows: repeat(90, 150px);

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文