How to make a site header rubber, to adapt to different browser sizes.
HTML
<div class="header"> </div> CSS
.header{ background: url(../img/header.jpg); } ...">
How to make a site header rubber, to adapt to different browser sizes.
HTML
<div class="header"> </div> CSS
.header{ background: url(../img/header.jpg); } Please correct the question so that it describes the specific problem with sufficient detail to determine the appropriate answer. Do not ask a few questions at once. See “How to ask a good question?” For clarification. If the question can be reformulated according to the rules set out in the certificate , edit it .
header { width: 100%; min-height: 150px; background-color: transparent; background-image: url("http://www.avionindia.com/images/Header.jpg"); background-repeat: no-repeat; background-position: center; background-size: cover; overflow: hidden; } <header></header> % - Yurivw takes a scroll bar for width and a horizontal scroll may appear - Yurioverflow-x: hidden and this is not always convenient - YuriThis is how it should work:
.header{ background: url(../img/header.jpg); width: 100%; height: auto; } .header { background: url(../img/header.jpg) no-repeat center; backgriund-size: cover; height: 100vh; width: 100%; } height: 100vh - sets the height equal to the height of the window
Source: https://ru.stackoverflow.com/questions/601075/
All Articles
width: 100vw;? - SLy_huhbackground-size,background-repeat. If you want different styles for different screen sizes, use media queries. - check1st