E
E
Erl2015-11-10 10:36:13
css
Erl, 2015-11-10 10:36:13

How to properly scale img?

.main {
width:100%;
height:100%;
background-image: url(img/bg.jpg); }
main div stretched to the full width of the monitor, when resizing, the picture is static, is it possible to make it so that when the size is reduced, the picture shifts, that is, so that the visible area is always the center of the picture

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Mikhail, 2015-11-10
@NooBiToo

Something like this?
jsfiddle.net/35h6a86r

D
Denis Ineshin, 2015-11-10
@IonDen

background-size: cover;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question