Refresher on centring with css flex

  • display: flex for the main container
  • justify-content and align-items to center
  • vh and vw units are percentage points of the viewport. To have an element take half the screen width use max-width: 50vh.
  • Can set body to height: 100% and margin: 0. Can also use vh units.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: