I would like to create a full width header image that changes in size by percentage according to device. It is an incremental zooming-in-like effect upon one image instead of having to use separate ones of different pixel sizes.
What is the best way to code this effect in CSS and HTML? Working in Dreamweaver, I have tried a number of approaches with no success. With the code below, a narrow strip (only) of the bottom of the image shows in DW the design view div. So the image path is correct. However, no image at all appears in the browser preview. Any help would be greatly appreciated.
<div class="header-image">
</div>
.header-image {
background-image: url("header-image.png");
background-size: contain;
background-repeat: no-repeat;
}
@media only screen and (max-width: 992px) {
.header {
max-width: 125%;
}
@media only screen and (max-width: 768px) {
.header {
max-width: 150%;
}
}
@media only screen and (max-width: 567px) {
.header {
max-width: 200%;
}
}