0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Bootstrap4のSpacing

Posted at

Spacing

property

m - margin
p - padding

sides

Bootstrap5をちょっとだけ

Bootstrap4 Bootstrap5
t top t top
b bottom b bottom
l left s start
r right e end
x left & right x left & right
y top & bottom y top & bottom

size

$spacer=1rem=16px。$spacers Sassマップ変数にエントリを追加することで, サイズの追加可能

0 1 2 3 4 5
$spacer× 0 $spacer× .25 $spacer× .5 $spacer $spacer × 1.5 $spacer × 3

auto - for classes that set the margin to auto
marginの場合、数字の前に n をつけるとマイナスに 例)mt-n1

ブレークポイント

xs sm md lg xl
Extra small Small Medium Large Extra large
<576px ≥576px ≥768px ≥992px ≥1200px

記載方法

<div class="ml-1">左に(16px × 0.25)のmargin</div>
<div class="px-md-5">幅768px以上の時は 左右に(16px × 3)のpadding</div>
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?