thisislawatts / coverimage

Background Image without the CSS

Home Page:http://thisislawatts.github.io/coverimage/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CoverImage

Scrutinizer Code Quality

Takes an element and uses the first image found to replicate the behaviour of background-size: cover from CSS.

The advantage of this method is that you get all the semantics/accessibility of an image present within the mark-up.

Usage

 <div data-cover-image>
   <img src="http://example.com/cat.jpg"/>
 </div>
 <script src="https://unpkg.com/coverimage/dist/coverimage.js"></script>

Contributing

Please do.

About

Background Image without the CSS

http://thisislawatts.github.io/coverimage/

License:MIT License


Languages

Language:JavaScript 89.5%Language:HTML 10.5%