Skip to content

Instantly share code, notes, and snippets.

@AmatsukiKu
Last active May 18, 2017 03:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AmatsukiKu/eab0af2c3a211167ed72431521aaa19a to your computer and use it in GitHub Desktop.
Save AmatsukiKu/eab0af2c3a211167ed72431521aaa19a to your computer and use it in GitHub Desktop.
sizesの指定が一つの場合のsrcsetのサンプル
<html>
<head>
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no" />
<style>
body {
min-width: 0;
text-align: center;
padding: 0;
margin: 0;
}
img {
min-width: 0;
padding: 0;
margin: 0;
}
</style>
</head>
<body>
<img sizes="80vw" srcset="https://dummyimage.com/100x100/000/fff 100w, https://dummyimage.com/200x200/000/fff 200w, https://dummyimage.com/300x300/000/fff 300w, https://dummyimage.com/400x400/000/fff 400w, https://dummyimage.com/500x500/000/fff 500w, https://dummyimage.com/600x600/000/fff 600w, https://dummyimage.com/700x700/000/fff 700w, https://dummyimage.com/800x800/000/fff 800w" src="https://dummyimage.com/10x10/000/fff" />
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment