網格超過身體,用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身體。