Search code examples
csstwitter-bootstrapvertical-alignment

Bootstrap Vertically div full background


I'm using bootstrap framework for a project, but I'm having trouble with a central div for my site.

I need to put a div vertically centered but with a background color for 100% full width, and inside the container div of bootstrap.

I need to build the blue part (Central DIV) of the image http://www.hmsg.net/layout.png


Solution

  • Try this

    <div class="col-lg-12"
         style="padding:0px; background-image: url('http://www.kiteworldmag.com/media/wallpapers/2/187/3.jpg'); background-size: 100% auto; height:500px;;">
      <div class="col-lg-12" style="height:300px; padding:0px; margin:0px; display: block">
      </div>
      <div class="col-lg-12" style="background-color:#ffffff; height:100px; padding:0px; margin:0px;">
        sdfsdf
      </div>
    </div>