Good day. The task is as follows.
There is a code.
The task is that, depending on the width of the screen and its height, the block is always in the screen either at 100% of the width or at 100% of the height. Moreover, block sizes should always be proportional to the size of the background. How to do it?
Here is the code itself
body { font-family: 'San Francisco', Arial; } .container { height: 100vh; width: 100%; max-width: 1920px; background: url('http://nubilonline.savgroup.ru/bg_1.png') no-repeat center; background-size:contain; } .container > .header { border: 1px solid red; height: 3vh; }
<div class="container"> <div class="header"> header line </div> <div class="content"> </div> <div class="footer"> </div> </div>
Here are graphic examples of what I'm talking about.
http://nubilonline.savgroup.ru/pic1.PNG http://nubilonline.savgroup.ru/pic2.PNG