Read more

Centering with CSS vertically and horizontally (all options overview)

Henning Koch
February 01, 2016Software engineer at makandra GmbH

Use Flexbox for everything.

There are a million ways to center <div>s or text in CSS, horizontally or vertically. All the ways are unsatisfying in their own unique way, or have restrictions regarding browser support, element sizes, etc.

Illustration online protection

Rails Long Term Support

Rails LTS provides security patches for old versions of Ruby on Rails (2.3, 3.2, 4.2 and 5.2)

  • Prevents you from data breaches and liability risks
  • Upgrade at your own pace
  • Works with modern Rubies
Read more Show archive.org snapshot

Here are two great resources for finding the best way of aligning something given your use case and browser support requirements:

How to center in CSS Show archive.org snapshot
: A long form that lets you define your use case and browser support requirements, then shows you the preferred way of aligning.

Centering CSS: A complete guide Show archive.org snapshot
: A textual guide showing all the options for all use cases.

Posted by Henning Koch to makandra dev (2016-02-01 09:26)