F
F
freestm2016-10-29 21:39:33
css
freestm, 2016-10-29 21:39:33

How to make a background image in the header of the site so that it looks good both at small resolutions and at large ones?

The image should occupy the entire area of ​​the browser in width. But if a person opens a site on a 4k monitor, then where can I find such a picture ... what are the solutions for people with a higher resolution?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
V
Valmih, 2016-10-29
@Valmih

Try something like this
background-attachment: fixed;
background-image: url("../img/bcg.png");
background-position: center center;
background-repeat: no-repeat;
background-size: cover;

D
Dmitry Khristoev, 2016-10-30
@Haoss

imulus.github.io/retinajs

H
Halcod, 2017-03-06
@Halcod

Surely you have a limited maximum width of the site column (container) that contains the header, for example 1170px
It is this width that the picture corresponds to and it will not become wider. (If everything is correct)
If it falls out of the general site column and you need it (you does that suit you?), then you were offered retinajs as an option.
But usually caps have a limited width.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question