Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

bootstrap cover template: where to place image?

This is a complete newbie question, but:

Using Bootstrap's cover template, how/where should I insert the background image to cover the page?

What I am I missing? I have tried inserting the inside the following elements in the template

 <div class="site-wrapper-inner">
 <div class="cover-container">
 <div class="inner cover">

the image is shown but not sized to fill the viewport's dimensions.

(Or am I misunderstanding the purpose of this template?)

like image 719
lara michaels Avatar asked Aug 28 '14 19:08

lara michaels


People also ask

How do I fit a background image in bootstrap?

Bootstrap has the built-in img-responsive class for this purpose. This applies max-width: 100%;, height: auto; and display: block; to the image so that it scales nicely to the parent element.

How do I write over an image in bootstrap?

Add class=carousel-caption to the HTML tag which contains your text which needs to be positioned over your image !. (And then if you wish add custom css top:xyz% to your . carousel-caption class in css stylesheet to make it align vertically at middle.)


1 Answers

Based on where the background image is applied, it looks like the background is applied to the body tag. In which case apply this CSS:

body { 
  background: url(images/bg.jpg) no-repeat center center fixed; 
  -webkit-background-size: cover;
  -moz-background-size: cover;
  -o-background-size: cover;
  background-size: cover;
}

"cover" causes the background to fill the block element.

like image 168
Berto Avatar answered Oct 07 '22 17:10

Berto