Snippets

Horizontal & Vertical Align Example

Align div content both horizontally and verically.

July 3, 2017

align

Horizontal & Vertical Align Example

Horizontal & Vertical Align

<div class="tcontent"> <p>Horizontal & Vertical Align</p> </div> .tcontent { display: flex; height: 300px; margin: 0; font-size: 1.6em; background: #fff; } .tcontent p { display: inline-block; margin: auto; align-self: center; }

Related Content

Easy Way to Fix Anchor Links Scrolling Too Far

Stories

Easy Way to Fix Anchor Links Scrolling Too Far

Fixed navbar is a very popular way of displaying navigation when a page is scrolled, but you could run into a small detail that needs to be addressed.

How to Avoid Page Flickering When Scrollbars are Dynamically Shown or Hidden?

Stories

How to Avoid Page Flickering When Scrollbars are Dynamically Shown or Hidden?

There are certain cases when you want to dynamically manipulate the page height which will result in flickering.

Changing the Mouse Cursor in CSS With the cursor Property

Stories

Changing the Mouse Cursor in CSS With the cursor Property

Using CSS to change the cursor on your website is a great way to add a little bit of personality to your site.