网格超过身体,用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">
By using fr units, the grid will now distribute the space correctly, ensuring that it remains within the bounds身体。