3

in bootstrap, we can add margin from 0-5 but I want to add more margin using bootstrap , I tried the following m-8 but it's not working

  • 1
    `m-8` is not available, if you want `m-8` then you need to make class, or inline css, like `margin : 6rem;` – STA Aug 05 '20 at 19:16

1 Answers1

1

You can add new spacer definitions to the $spacers variable, use your own custom.scss for that, like so:

// 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";

basically anything you can find in _variables.scss that's relevant for you, you can override.

see this answer for more details: https://stackoverflow.com/a/46125059/3584353

and about overriding bootstrap variables here: https://getbootstrap.com/docs/4.0/getting-started/theming/