A simple JavaScript library to help you centralize content in the center of your device's screen or HTML element/container.
You can install directly via NPM to your project folder.
npm install html-centralize-js
The CDN is updated after the release is made public. Always, check the GitHub page for the latest release.
- https://cdn.jsdelivr.net/gh/chigozieorunta/centralize.js/centralize.css
- https://cdn.jsdelivr.net/gh/chigozieorunta/centralize.js/centralize.js
The "centralize" class comes in handy if you ever need to centralize content in the center of your device's screen or HTML element/container.
The centralize class applies a 100% width & height to its parent container and centralizes the content at the center of the screen. Here's a sample below...
<!DOCTYPE html>
<html>
<head>
<link href="https://cdn.jsdelivr.net/gh/chigozieorunta/centralize.js/centralize.css" rel="stylesheet" type="text/css"/>
<script src="https://cdn.jsdelivr.net/gh/chigozieorunta/centralize.js/centralize.js" type="text/javascript"></script>
</head>
<body>
<section class="centralize">
You are centralized!!!
</section>
</body>
</html>