Centering Any Element In JavaScript – centralize.js

Category: Javascript , Layout | November 7, 2019
Author: chigozieorunta
Views Total: 36
Official Page: Go to website
Last Update: November 7, 2019
License: MIT

Preview:

Centering Any Element In JavaScript – centralize.js

Description:

The centralize.js library provides a simple and cross-browser solution to center any element horizontal and vertical, without writing confusing CSS rules.

How to use it:

1. Link to stylesheet centralize.css and JavaScript centralize.js.

<link href="centralize.css" rel="stylesheet">
<script src="centralize.js"></script>

2. Add the CSS .centralize element to the element. That’s it.

<div class="centralize">
  <h1>I'm centralized<h1>
</div>

You Might Be Interested In:


Leave a Reply