https://github.com/oskarrough/rough-cover
Fallback for background-size: cover
https://github.com/oskarrough/rough-cover
Last synced: 3 days ago
JSON representation
Fallback for background-size: cover
- Host: GitHub
- URL: https://github.com/oskarrough/rough-cover
- Owner: oskarrough
- License: mit
- Created: 2013-05-21T15:24:37.000Z (about 13 years ago)
- Default Branch: master
- Last Pushed: 2013-11-27T12:52:37.000Z (over 12 years ago)
- Last Synced: 2026-03-08T12:25:25.793Z (4 months ago)
- Language: JavaScript
- Homepage:
- Size: 137 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Rough: Cover
As [background-size](http://caniuse.com/#feat=background-img-opts) isn't too well supported, this component will check for `background-size` support and create scalable and absolutely centered `img` out of the background images.
## Installation
* With [Bower](http://bower.io/): `bower install --save rough-cover`
* With git: `git clone https://github.com/oskarrough/rough-cover.git`
* As download: [zip](https://github.com/oskarrough/rough-cover/zipball/master)
## Getting started
* `
` - will scale height based on width. Be sure to edit the ratio in the CSS.
* `` - will center image both horizontally and vertically inside the fixed dimensions. Be sure to edit the height in the CSS.
* If you want these default styles, be sure that the element that contains the background image has the class `.Cover`.
And Check the demo.html