CSSで上下左右を中央寄せにします。 レスポンシブ対応ですが、横幅が狭いときの挙動が少し違います。
position:absolute
See the Pen box-center-absolute by 25egg (@25egg) on CodePen.
flexbox
See the Pen box-center-flex by 25egg (@25egg) on CodePen.
こちらのブログは2023年内に閉鎖予定です。
新ドメイン:https://grinee.net/
お気に入りやブックマークに登録されている方は変更をお願いいたします。
CSSで上下左右を中央寄せにします。 レスポンシブ対応ですが、横幅が狭いときの挙動が少し違います。
See the Pen box-center-absolute by 25egg (@25egg) on CodePen.
See the Pen box-center-flex by 25egg (@25egg) on CodePen.