首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在bootstrap中添加超过5的边距

在bootstrap中添加超过5的边距
EN

Stack Overflow用户
提问于 2020-08-06 02:15:57
回答 1查看 571关注 0票数 1

在bootstrap中,我们可以添加0-5的保证金,但我想使用bootstrap添加更多的保证金,我尝试了以下m-8,但它不起作用

EN

回答 1

Stack Overflow用户

发布于 2020-08-06 16:10:12

您可以将新的间隔符定义添加到$spacers变量,为此使用您自己的custom.scss,如下所示:

代码语言:javascript
复制
// 1. import bootstrap's variables to override them
@import "../node_modules/bootstrap/scss/variables";

// 2. your overrides
$spacers: (
  0: 0,
  1: ($spacer * .25),
  2: ($spacer * .5),
  3: $spacer,
  4: ($spacer * 1.5),
  5: ($spacer * 3),
  6: ($spacer * 5)
)

// 3. bootstrap and its default variables
@import "../node_modules/bootstrap/scss/bootstrap";

基本上,您可以在_variables.scss中找到任何与您相关的内容,您都可以覆盖它们。

有关更多详细信息,请参阅此答案:https://stackoverflow.com/a/46125059/3584353

关于在这里覆盖引导程序变量:https://getbootstrap.com/docs/4.0/getting-started/theming/

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/63271220

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档