Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/aFarkas/lazysizes into gh…
Browse files Browse the repository at this point in the history
…-pages
  • Loading branch information
aFarkas committed Jan 12, 2019
2 parents 03bfca7 + f6f0005 commit ec45013
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions plugins/aspectratio/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

This plugin helps to pre-occupy the space needed for an image by calculating the height from the image width or the width from the height (This means the width or height has to be calculable before the image is loaded). This can serve as an alternative to the different CSS intrinsic ratio patterns.

Note: The CSS patterns are recommended, but especially in case of different ratio's for art directed images not so convenient.
Note: The CSS patterns are recommended, but especially in case of different ratio's for art directed images not so convenient. This plugin removes the ``data-aspectratio`` attribute after processing each image and my not play well with other plugins that rely on this attribute.

## Markup API:

The value of the ``data-aspectratio`` has to be defined as the *width* divided by the *height* of the image.
The value of the ``data-aspectratio`` has to be defined as the *width* divided by the *height* of the image and can be represented as a ratio or a floating point number.

Example values for an image with a width of 400 and a height of 200 (all mean the same): ``"400/200"``, ``"4/2"``, ``"2/1"``, ``"2"``
Example values for an image with a width of 400 and a height of 200 (all mean the same): ``"400/200"``, ``"4/2"``, ``"2/1"``, ``"2"``, ``"2.0"``

```html
<img
Expand Down

0 comments on commit ec45013

Please sign in to comment.