fixedで要素を中央に配置する

ネガティブマージンを設定する。

widthheightに指定したサイズの1/2の数値をそれぞれmargin-leftmargin-topに指定する。 なるほど。

See the Pen fixedで要素を中央に配置する by soto-ogre (@soto-ogre) on CodePen.