LoginSignup
1

More than 5 years have passed since last update.

良い感じのテキストセンタリングの CSS

Last updated at Posted at 2018-11-14

text-align: center だと微妙なセンタリングになる事がちょこちょこと。
と言う事で、ブロックはセンタリング、中身は左寄せに、をシンプルにやる CSS。

display: table;
margin-left: auto;
margin-right: auto;

テーブルにするとマージンの上下相殺が出来ないのでその辺りご注意を。

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1