CSSの一括指定 「background」
参考サイト
CSSのプロパティのショートハンド11個まとめ!イラストを使ったチートシートで解説 | webliker
自分なりにまとめてみました。
1.background-color:背景色
2.background-image:背景画像
3.background-repeat:背景画像の繰り返し
4.background-position:背景画像の位置
5.background-cover:背景画像の固定
6.background-attachment:背景画像の大きさ
ショートハンド
例 border: 1 2 3 4 56
.el{background: #333 url(bg.png) no-repeat 0% 5% fixed/cover}
- 1~6を全て書く必要はない
- 「background-color」を書くだけでもいい
- 「background-position」は「左右 上下」の順番で書く