It's a very simple and straightforward code:
HTML markup:
<div class="jumbotron text-center top-jumbotron">
</div>
CSS:
.top-jumbotron {
background: #ffcc00;
background-image: url('../../bootstrap/img/home-page-banner.jpg');
background-size: 100% auto;
padding: 0px;
margin: 0px;
border: none;
}
My image is 2880px wide and shows just fine if I specify the width in px in the CSS. However, I am wary of using hard-coded metrics because I need the div to scale across all displays from mobile to Retina. Is there any way to make the image show up while using a percentage dimension for background-size? I don't want to use the <img>
tag in HTML because I will be superimposing some text and other elements over the div; hence the background.