如何将css网格中的pixel转换为fr?
我有一个总宽度为 1000px 的 div 容器,我决定使用 CSS 网格分隔 5 列。 网格模板列:100px 100px 100px 600px 100px; 如何将此像素转换为 fr ? 网格模板列:?fr ?fr ?fr ?fr ?fr;
I have a div container with a total width of 1000px and I decided to separate 5 columns using a CSS grid.
grid template columns : 100px 100px 100px 600px 100px;
how to convert this pixel to fr ?
grid template columns : ?fr ?fr ?fr ?fr ?fr;
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用
1fr 1fr 1fr 600px 1fr
这将使第 4 个减少 600px,其余部分将根据剩余空间进行调整You can use
1fr 1fr 1fr 600px 1fr
which will make 4th one off 600px and rest will adjust according to remaining space您能详细说明一下吗?您还没有指定您想要或不想要的间隙。
现在你能做什么
另外,假设如果你想要列之间有 10px 的间隙,那么可以通过以下方式实现相同的效果:
Can you please elaborate more on this? You haven't specified gap you want or not.
what can you do for now
Also, let's say if you want a gap of 10px between the columns, then the same could be acheived by: