Skip to content

Instantly share code, notes, and snippets.

@dongyuwei
Created July 31, 2015 06:40
Show Gist options
  • Select an option

  • Save dongyuwei/841f0e8b1d9672688ca2 to your computer and use it in GitHub Desktop.

Select an option

Save dongyuwei/841f0e8b1d9672688ca2 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS responsive images</title>
<style>
@media (min-width:640px) {
.img-box img{
width: 0;
height: 0;
position: relative;
}
.img-box:after{ /* or .img-box:before */
position: absolute;
z-index: 1;
content: url(http://127.0.0.1:5000/blob/1:32:284bde13-efe9-4339-9f24-072582b639de);
}
}
</style>
</head>
<body>
<div class='img-box'>
<img src="http://127.0.0.1:5000/blob/1:20:38d5633c-a402-487b-bc57-5a1e2b895891">
</div>
</body>
</html>
@dongyuwei
Copy link
Copy Markdown
Author

content: "";
background: url(http://127.0.0.1:5000/blob/1:32:284bde13-efe9-4339-9f24-072582b639de) no-repeat;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment