# div.center

> We all know what the hardest task is, an impossiable feet to acoumplish, derailing many aspiring web developers.

Latest version **1.0.0** (published 2021-12-26) · WTFPL license · 0 weekly downloads

## Install

```sh
npm install div.center
pnpm add div.center
yarn add div.center
bun add div.center
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2021-12-26 |
| First published | 2021-12-26 |
| Weekly downloads | 0 |
| License | WTFPL |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 11 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Nathan Hare |
| Maintainers | laspruca |

## Links

- npm: https://www.npmjs.com/package/div.center
- Repository: https://github.com/laspruca/div.center
- npm.io page: https://npm.io/package/div.center

## Recent versions

- 1.0.0 (latest) — 2021-12-26

## README

# div.center

We all know what the hardest task is, an impossiable feet to acoumplish, derailing many aspiring web developers.

This tedios task?

Centering the nobel div

`div.center` provides an elagant api for centering your div.

# Example

```html
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Center that div</title>
  </head>
  <body>
    <script src="path/to/center.div/index.js"></script>
    <script>
      // Specify the ID of the div we would like to center, you can provide a HTMLElement if you would like to aswell
      let div = new Div("cm");

      // Center the div
      div.center();
    </script>
    <div class="max">
      <div id="cm">I need centering</div>
    </div>
    <style>
      * {
        margin: 0;
      }

      .max {
        width: 100vw;
        height: 100vh;
        max-width: 100%;
        max-height: 100%;
      }
    </style>
  </body>
</html>
```

It's just that easy!

---
_Source: https://npm.io/package/div.center · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
