A
Anonymous
June 21, 2016
Question
How to Make Background Image Responsive?
- June 21, 2016
- 1 reply
- 3588 views
I'm trying to make my background image responsive, but right now, it remains the same size no matter what size the viewport is. I would like the image to shrink and remain centered as the viewport shrinks. Below is the corresponding code, and I've attached images.
.section-background-image {
- position: absolute;
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
}
.parallax {
- position: fixed!important;
}
<div class='section-background-image parallax'>
<img class='mktoImg' id='heroImg' mktoName="Hero Image" src='info.liveintent.com/rs/920-LJZ-738/images/AdvertiserHeroImage.jpg'>
</div>