D
D
Denis Bukreev2017-04-30 23:37:31
css
Denis Bukreev, 2017-04-30 23:37:31

How to set a repeating background on retina displays?

So it goes.
It wasn't until I bought a Macbook with retina that I realized I never cared about backgrounds for retina displays.
With the usual non-repeating pictures, everything is clear.
But what about repeating seamless backgrounds?
You can't take twice the big picture for them, set bgsz: 100%/cover/contain and enjoy life.
How to be then?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Pavel Radkov, 2017-05-01
@paulradzkov

It is necessary to prescribe two backgrounds - a normal one, and a "retina" one through media queries:

.something {
    background-image: url(path/to/[email protected]);
}
@media screen and (min-resolution: 2dppx) { 
     .something {
        background-image: url(path/to/[email protected]);
    }
}

https://developer.mozilla.org/en-US/docs/Web/CSS/M...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question