CSSで画像のサイズを変える場合、
transform: scale(0.5)
のようにすることがあるが、このときのmargin
やposition
は画像のもとのサイズが基準になっているっぽい。というか、それらを適用した後にそれごとサイズ変更してる感じ。
これを知らなくて、
position: absolute;
left: 0;
bottom: 0;
としたのに変な余白ができちゃう、みたいなことになったので注意したい。
transform:scale()
はあくまでも要素を拡大・縮小するプロパティ。
More than 5 years have passed since last update.
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme