Faced such a problem: the layout I found on the Internet was made in sizes 1200 (height) by 2000 (width). I started to make a background image, but it does not line up to those dimensions (for my screen is 1368 by 720 (px)). The screenshot of the layout itself is below. Please help if anyone knows the solution. Ps background-size does not help ...
1 answer
*{ margin:0; } html,body{ height:100%; } .main{ width:100%; height:100%; background:url(https://avatanplus.com/files/resources/original/574aa9aab6ec4154fba6c2fd.jpg); background-size:100% 100%; } <div class="main"></div> background-size always and everywhere worked, there is an example of work both in the snippet and in the codepen , only the question is not that, but why should we load sites with heavy images? and by the way, here is the original image I used, 3750x2500 - this is an impressive size
- Well, I agree about the download. Yes, and with bg-size'om too, before there were no problems. But for some reason right now ... - Andrei
- And right - it works. Apparently something wrong with the height did. At least I did not specify it in html. - Andrei
|
