I\'m trying to set the size (both width and height) of a div to match it\'s background image size, but I can\'t get it working. The background image size has to be in percen
*{ padding: 0; margin: 0; } div{ width: 100%; } div figure{ padding-top: 36.56%; /* 702px/1920px = 0.3656 */ display: block; background: url("https://st.fl.ru/images/landing/bg2.jpg") no-repeat center top; background-size: cover; }