1
1

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 5 years have passed since last update.

marginとpaddingって結局どっち使えばいいんだっけ

Last updated at Posted at 2020-03-11

たまに扱うと分からなくなるので。

ここの議論と図が分かりやすかった。
こういう時は~ vs ~ 検索がやっぱいいですね。
When to use margin vs padding in CSS [closed]

この図が全て。
image.png
画像: https://www.w3schools.com/css/css_boxmodel.asp

Contentと別Contentとの間にスペース作りたい時はmargin
ContentとContent自身のBorderとの間にスペース作りたい時はpadding

という認識。

1
1
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
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?