dkjain
dkjain

Reputation: 871

Bootstrap 3 container within container-fluid

I am re-coding an opencart theme but this time using bootstrap 3. Is it the correct / recommended way to place bootstrap container within a container-fluid to have a central container. If not which would be a more correct to achieve this.

HTML

<div id="container-fluid">
<div id="container">
 <div class="row"> 
  <?php if ($logo) { ?>

 <div class="col-sm-3">
    <div id="logo"><a href="<?php echo $home; ?>"><img class="img-responsive" src="<?php echo $logo; ?>" title="<?php echo $name; ?>" alt="<?php echo $name; ?>" /></a></div>
  <?php } ?>
  </div>
  <div class="col-sm-6">
    <div id="pringle"><img src="catalog/view/theme/default/image/pringle.png" /></div>
  </div>
 </div>
 </div>
 </div><!-- Static Header Ends-->

Bootstrap container within container-fluid

Upvotes: 1

Views: 2113

Answers (2)

Pepelius
Pepelius

Reputation: 1609

Yes.

.container can be used with .container-fluid to give you better possibilities on styling your header's background.

Since the fluid container itself does not have much styling on it, you can use it to divide different parts of the page vertically. Adding an extra class or an ID to it gives you a bit of freedom when it comes to applying CSS-styling on it.

It should not cause any issues except when you go to mobile view, you should maybe tick off the padding from .container-fluid if you want to fill the page's width with your header.

Upvotes: 2

Greg
Greg

Reputation: 78

Why does the container have to be inside the container-fluid?

Could you make the container a container-fluid and give it a margin? Or make them both container-fluid?

Upvotes: -1

Related Questions