UNPKG

html-centralize-js

Version:

A simple JavaScript library to help you centralize content in the center of your device's screen or HTML element/container.

45 lines (39 loc) 1.46 kB
# centralize.js A simple JavaScript library to help you centralize content in the center of your device's screen or HTML element/container. ## NPM You can install directly via NPM to your project folder. ``` npm install html-centralize-js ``` ## CDN The CDN is updated after the release is made public. Always, check the GitHub page for the latest release. <ul> <li> <a href="https://cdn.jsdelivr.net/gh/chigozieorunta/centralize.js/centralize.css"> https://cdn.jsdelivr.net/gh/chigozieorunta/centralize.js/centralize.css </a> </li> <li> <a href="https://cdn.jsdelivr.net/gh/chigozieorunta/centralize.js/centralize.js"> https://cdn.jsdelivr.net/gh/chigozieorunta/centralize.js/centralize.js </a> </li> </ul> ### Usage 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. ### How To Use 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> ```