Last active
October 3, 2020 13:13
-
-
Save belocer/8447156af92dcbdf1c1176db5515354f to your computer and use it in GitHub Desktop.
Retina
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
<img src="img/img_x1.jpg" | |
srcset="img/img_x2.jpg 2x img/img_x3.jpg 3x"> | |
<img src="img/img_x1.jpg" | |
srcset="img/img_x2.jpg 500w img/img_x3.jpg 700w img/img_x4.jpg 1000w"> |
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
.block { | |
background-image: url('img/img_x1.jpg') | |
} | |
@media (-webkit-min-device-pixel-ratio: 1.5), (min-resolution: 144dpi) { | |
.block { | |
background-image: url('img/img_x2.jpg') | |
} | |
} | |
/* OR */ | |
.block { | |
width: 400px; | |
height: 400px; | |
background: url('img/img_x2.jpg') center center no-repeat no-repeat; | |
background-size: contain; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment