1.0.2 • Published 8 years ago

center-bg v1.0.2

Weekly downloads
3
License
MIT
Repository
github
Last release
8 years ago

center-bg

Set any size image to div background with center alignment

Install

npm install center-bg

Example

<style>
  .box {
    width: 200px; height: 200px; /* define box width, height */

    float: left;
    margin-right: 10px;
  }
</style>

<div class='box' src='./1.png'></div>
<div class='box' src='./2.png'></div>
<div class='box' src='./3.png'></div>

<script src='./center-bg.js'></script>
<script> center_bg('box'); </script>