fixedで要素を中央に配置する
ネガティブマージンを設定する。
width
、height
に指定したサイズの1/2の数値をそれぞれmargin-left
、margin-top
に指定する。
なるほど。
See the Pen fixedで要素を中央に配置する by soto-ogre (@soto-ogre) on CodePen.
ネガティブマージンを設定する。
width
、height
に指定したサイズの1/2の数値をそれぞれmargin-left
、margin-top
に指定する。
なるほど。
See the Pen fixedで要素を中央に配置する by soto-ogre (@soto-ogre) on CodePen.