Skip to content

Commit

Permalink
Document workaround for broken image symbol
Browse files Browse the repository at this point in the history
  • Loading branch information
aFarkas committed Mar 26, 2019
1 parent 6d28945 commit 6a906c4
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,20 @@ lazysizes adds the class ``lazyloading`` while the images are loading and the cl
}
```

### Broken image symbol

In case you are using an `alt` attribute but do not declare a `src`/`srcset` attribute you will end up with a broken image symbol.

There are two easy ways to deal with it.

Either define a `src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="` or add the following CSS.

```css
img.lazyload:not([src]) {
visibility: hidden;
}
```


### JS API
**lazysizes** automatically detects new elements with the class ``lazyload`` so you won't need to call or configure anything in most situations.
Expand Down

0 comments on commit 6a906c4

Please sign in to comment.