-
-
Save tanepiper/2652370 to your computer and use it in GitHub Desktop.
Responsive Images
This file contains hidden or 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
| /* Responsive Images */ | |
| .r-img { | |
| background-size: 100%; | |
| display: inline-block; | |
| zoom: 1; | |
| *display: inline; /* Mimic inline-block on old IE */ | |
| } | |
| @media screen and (max-width: 600px) { /* Hide background on low res */ | |
| .r-img { | |
| background: none !important; | |
| } | |
| } | |
| .r-img img { | |
| display: block; | |
| position: relative; | |
| } | |
| @media screen and (min-width: 600px) { | |
| .r-img img { | |
| opacity: 0; | |
| } | |
| } |
This file contains hidden or 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
| <div class=r-img style="background-image: url(http://placedog.com/256/256);"> | |
| <img src="http://placedog.com/128/128"> | |
| </div> |
This file contains hidden or 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
| {"view":"separate","fontsize":"100","seethrough":"","prefixfree":"1","page":"all"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment