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

スタイルを当てやすくする豆知識 padding/margin編 入門者向け

Last updated at Posted at 2020-07-05

padding/marginのリセット

styles.css
* {
  padding: 0;
  margin : 0;
}

サイトの模写をしていると、なぜか意図しない余白が付けられて困ったときの対処法として、

上記のコードをCSSに記述することで、意図しない余白を消すことができる。

※ 「*」
これは、全称セレクタと言って、全ての要素を対象にする。

参考サイト:http://www.htmq.com/tutorial/08_5.shtml

これを記述した途端に、思い通りのスタイルを当てることができるようになったので、共有します。

基本的な知識だけど、これからのコードを書く際の準備に付け加えていきます。

0
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
0
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?