”工欲善其事,必先利其器。“—孔子《论语.录灵公》
首页 > 编程 > 为什么使用固定定位时,为什么具有100%网格板柱的网格超越身体?

为什么使用固定定位时,为什么具有100%网格板柱的网格超越身体?

发布于2025-06-14
浏览:148

Why does a grid with 100% grid-template-columns extend beyond the body when using fixed positioning? 
网格超过身体,用100%grid-template-columns

为什么在grid-template-colms中具有100%的显示器,当位置设置为设置的位置时,grid-template-colly修复了?

问题: 考虑以下CSS和html:

class =“ snippet-code”>

grid-gap:5px;

背景:#eee;

。 lang-html prettyprint-override”>

left
right'> right'> right
但是,当将位置设置为固定时,网格将延伸到右侧的身体。

Instead, rely on the fr unit to distribute the free space proportionally, taking into consideration the grid gap:




grid-gap:5px;
背景:#eee;
。 lang-html prettyprint-override">

LEFT

RIGHT




By using fr units, the grid will now distribute the space correctly, ensuring that it remains within the bounds身体。
最新教程 更多>

免责声明: 提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发到邮箱:[email protected] 我们会第一时间内为您处理。

Copyright© 2022 湘ICP备2022001581号-3