Created
June 7, 2019 11:57
-
-
Save flexchar/0656eca2bf8231529479f2d03f5d77ba to your computer and use it in GitHub Desktop.
Example of WebP not working inside <picture> tag
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>WebP Test</title> | |
<style> | |
body { | |
display: flex; | |
height: 100vh; | |
margin: 0; | |
justify-content: center; | |
align-items: center; | |
} | |
picture { | |
width: 50%; | |
} | |
picture > * { | |
max-width: 100%; | |
} | |
</style> | |
</head> | |
<body> | |
<picture> | |
<source type="image/webp" srcset="https://i.ytimg.com/vi_webp/2bVik34nWws/maxresdefault.webp"> | |
<source type="image/jpeg" srcset="https://i.ytimg.com/vi_webp/2bVik34nWws/maxresdefault.jpg"> | |
<img src="https://i.ytimg.com/vi_webp/2bVik34nWws/maxresdefault.jpg"> | |
</picture> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment