」工欲善其事,必先利其器。「—孔子《論語.錄靈公》
首頁 > 程式設計 > 為什麼使用固定定位時,為什麼具有100%網格板柱的網格超越身體?

為什麼使用固定定位時,為什麼具有100%網格板柱的網格超越身體?

發佈於2025-05-06
瀏覽:276

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