S
S
sunnyrio2018-11-17 14:22:31
css
sunnyrio, 2018-11-17 14:22:31

How to increase the height of a container by the ratio of its length?

There is a div1 container, it is stretched across the width of the screen and it has a background, how to make it so that when the screen is enlarged, the HEIGHT indicator increases in proportion to WIDTH so that the picture on the background is not cut off?

@media screen and (min-width: 1440px) {
  .div1 {
    width: 100%;
    height: 900px;
    background-image: url(background/space_and_stars/space_and_stars_1440.JPG);
  }
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Ankhena, 2018-11-17
@sunnyrio


Suitable bg size for the background, most often cover
https://webref.ru/css/background-size

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question