CSS background
Markups
#wrap {
background: no-repeat center fixed #fff;
background-size: cover;
}
@media only screen and (max-width: 767px) {
#wrap { background-image: url(small.jpg); }
}
@media only screen and (min-width: 768px) {
#wrap { background-image: url(medium.jpg); }
}
@media only screen and (min-width: 1280px) {
#wrap { background-image: url(large.jpg); }
}
Feature
#wrap { background-attachment: ; }
- background image on
body
- background image on
html
- background image on
position: fixed
block element
- 1
- 2