Answer the question
In order to leave comments, you need to log in
How to draw a background image correctly?
Hello. Such a question is how to properly prepare background images for the site, especially for retina monitors. What size should the background image be, and is there any criteria for background images?
Answer the question
In order to leave comments, you need to log in
body {
background-image: url("pic.png");
background-size: cover;
}
@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {
body {
background-image: url("pic-2x.png");
}
}
body {
background-image: url("pic.png");
background-image: -webkit-image-set(url("pic.png") 1x, url("pic-2x.png") 2x );
background-size: cover;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question