I'm new to twitters bootstrap. What want to know is the HTML mockup that i have to use for a full screen responsive background image with bootstrap?
certainly I'm suing the mockup
<div class="container-fluid">
<div class="wrapper">
</div>
</div>
Before the wrapper i do have a navigation menu. I want to add a full screen image to div class wrapper. and i want wrapper div to scale 100%. any tips will be greatly appreciated.
The most common & simple way to add background image is using the background image attribute inside the <body> tag. The background attribute which we specified in the <body> tag is not supported in HTML5.
Just add . bg-img class on your <img> element and .has-bg-img class to parent element that you want to apply a background image. Images are part of the DOM and are transformed into CSS background-image after they are fully loaded.
Two options
use img-responsive
class if you are using tag.
<div class="wrapper">
<img src="pic_1.jpg" class="img-responsive" alt="Responsive image">
</div>
if you are using css use this.
.wrapper{background: url('/assets/64531/green_suburb.jpg') no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With