Bootstrap 檔案解釋了如何
uj5u.com熱心網友回復:
@YaroslavTrach 的答案是正確的。
但是在他解釋如何正確地做到這一點之前,我一直在使用一個骯臟的解決方法。我在這里為那些不使用 scss 或在他們的專案中沒有基于節點的構建環境的人添加它。
我將常規mt-1等類添加到我的自定義 css 中,并修改了它們的名稱和值:
.mt-n1 { margin-top: -0.25rem !important; }
.mt-n2 { margin-top: -0.5rem !important; }
.mt-n3 { margin-top: -1rem !important; }
.mt-n4 { margin-top: -1.5rem !important; }
.mt-n5 { margin-top: -3rem !important; }
但是,如果您的前端確實有一個基于節點的構建環境,我推薦接受的答案,因為它為每個斷點添加類。
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/484778.html
標籤:推特引导 粗鲁的 引导程序 5 scss-mixins
上一篇:CSS-如何使動態引導串列可滾動
