Bootstrap, I can't get the container to be fluid (full width) col-md-12


Joel Wall

I've set the encoding to container-fluid so that my col-md-12 columns will cover the entire screen, but it only covers the right side, leaving a huge gap to the left of them. Here is my code, please help. I don't know if they could be other reasons, I don't see overuse of container fluids.

<style type="text/css"> .main-text {
  position: absolute;
  top: 50px;
  width: 96.66666666666666%;
  color: #FFF;
}
.btn-min-block {
  min-width: 120px;
  line-height: 26px;
}
.btn-clear {
  color: #FFF;
  background-color: transparent;
  border-color: #FFF;
  margin-right: 15px;
}
.btn-clear:hover {
  color: #000;
  background-color: #FFF;
}
.carousel-caption {
  text-align: center;
}
.container1 {
  margin-left: 15%;
  margin-top: 9%;
}
.container1img1 {
  margin-left: 15%;
}
.container1img2 {
  margin-left: -24%;
  margin-top: -10%;
}
.container {
  float: left;
  display: block;
  margin-top: 5%;
}
.demo-content img {
  display: block;
  margin-right: 5%;
}
.set4 > .row > .col-md-12 {
  background-color: black;
  height: 250px;
}
.set4 h2 {
  color: #FFFFFF;
}
</style>
<body>
  <div class="container-fluid main-content">
    <div class="row">
      <div class="col-md-12">
        <div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
          <ol class="carousel-indicators">
            <li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
            <li data-target="#carousel-example-generic" data-slide-to="1"></li>
            <li data-target="#carousel-example-generic" data-slide-to="2"></li>
          </ol>
          <div class="carousel-inner">
            <div class="item active">
              <img src="images/mainimg01.png" alt="First slide">
              <div class="carousel-caption">
                <h3></h3>
                <p>
                </p>
              </div>
            </div>
            <div class="item">
              <img src="images/mainimg01.png" alt="Second slide">
              <div class="carousel-caption">
                <h3>
                                </h3>
                <p>
                </p>
              </div>
            </div>
            <div class="item">
              <img src="images/mainimg01.png" alt="Third slide">
              <div class="carousel-caption">
                <h3>
                               </h3>
                <p>
                </p>
              </div>
            </div>
          </div>
          <a class="left carousel-control" href="#carousel-example-generic" data-slide="prev">
            <span class="glyphicon glyphicon-chevron-left"></span>
          </a><a class="right carousel-control" href="#carousel-example-generic" data-slide="next"><span class="glyphicon glyphicon-chevron-right">
                        </span></a>
        </div>
        <div class="main-text hidden-xs">
          <div class="col-md-12 text-center">
            <h1>
                        <img src="images/dslogo.png" alt="depot square"></h1>
            <h3>
                        Your elegant and affordable destination<br>for family, business and community events.
                    </h3>
            <div class="button">
              <a class="btn btn-clear btn-sm btn-min-block" href="http://www.jquery2dotnet.com/">MORE ABOUT US</a><a class="btn btn-clear btn-sm btn-min-block" href="http://www.jquery2dotnet.com/">CHECK AVAILABILITY</a>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
  <div id="push">
  </div>
  <div class="container1">
    <div class="row">
      <div class="col-md-3">
        <div class="headline">
          <H3>What Makes</H3>
          <h2>Depot Square Special?</h2>
          <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu,
            pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt.
            Cras dapibus. Vivamus elementum semper nisi.</p>
        </div>
      </div>
      <div class="row">
        <div class="col-md-3">
          <div class="container1img1">
            <img src="images/piano1.png">
          </div>
        </div>

        <div class="row">
          <div class="col-md-5">
            <div class="container1img2">
              <img src="images/venue1.png">
            </div>
          </div>
        </div>
        <div class="container set2">
          <!--Row with three equal columns-->
          <div class="row">
            <div class="col-md-4">
              <div class="demo-content">
                <img src="images/squareicon.png" class="pull-left">
                <h3>Versatile Spaces</h3>
                <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</p>
              </div>
            </div>
            <div class="col-md-4">
              <div class="demo-content bg-alt">
                <img src="images/pointericon.png" class="pull-left">
                <h3>Central Location</h3>
                <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</p>
              </div>
            </div>
            <div class="col-md-4">
              <div class="demo-content">
                <img src="images/foodicon.png" class="pull-left">
                <h3>Catering to Taste</h3>
                <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</p>
              </div>
            </div>
          </div>
        </div>
        <div class="container set3">
          <!--Row with three equal columns-->
          <div class="row">
            <div class="col-md-4">
              <div class="demo-content">
                <img src="images/stafficon.png" class="pull-left">
                <h3>Helpful Staff</h3>
                <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</p>
              </div>
            </div>
            <div class="col-md-4">
              <div class="demo-content bg-alt">
                <img src="images/soundicon.png" class="pull-left">
                <h3>Flexible Service</h3>
                <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</p>
              </div>
            </div>
            <div class="col-md-4">
              <div class="demo-content">
                <img src="images/supporticon.png" class="pull-left">
                <h3>Great Support</h3>
                <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</p>
              </div>
            </div>
          </div>
        </div>
        <div class="container-fluid set4">
          <div class="row">
            <div class="col-md-12 text-center">
              <h2>Past Events</h2>
              <div class="button1">
                <a class="btn btn-clear btn-sm btn-min-block" href="http://www.jquery2dotnet.com/">ALL EVENTS</a><a class="btn btn-clear btn-sm btn-min-block" href="http://www.jquery2dotnet.com/">CORPORATE</a><a class="btn btn-clear btn-sm btn-min-block"
                href="http://www.jquery2dotnet.com/">WEDDING</a><a class="btn btn-clear btn-sm btn-min-block" href="http://www.jquery2dotnet.com/">COMMUNITY</a><a class="btn btn-clear btn-sm btn-min-block" href="http://www.jquery2dotnet.com/">+</a>
              </div>
            </div>
          </div>
        </div>
      </div>
</body>

4 Ninja

Unless you want to manually reset the margins/padding for each case, you shouldn't add the container class to the parent div that will become full width.

This is what I think you want

Minimal working code is here

Basically, the hierarchy of divs goes div.container > div.row > div.col-xs-12/ div.col-md-6(and so on)..

If you are going to use a full width container like: ( div.conainer-fluid > div.container > div.row > div.col-md-6etc).

Related


Bootstrap col-md-12 not wrapping the full width of the screen

username I am creating a navbar and have placed a banner below it, but they are not 100% wide. I want them all to wrap 100% width. HTML(header.php) <!DOCTYPE html> <html> <head> <link rel="stylesheet" type="text/css" href="css/bootstrap.css"> <link rel

Bootstrap container fluid is not the full width of the screen

Blaze 26 I'm working on a website and I'm going to start with a mobile stylesheet first. But the width of the container fluid is not the same as the width of the window. The way I am trying to fix this is: .container-fluid{ width: 105% } The problem n

Bootstrap container fluid is not the full width of the screen

Blaze 26 I'm working on a website and I'm going to start with a mobile stylesheet first. But the width of the container fluid is not the same as the width of the window. The way I am trying to fix this is: .container-fluid{ width: 105% } The problem n

Bootstrap container fluid is not the full width of the screen

Blaze 26 I'm working on a website and I'm going to start with a mobile stylesheet first. But the width of the container fluid is not the same as the width of the window. The way I am trying to fix this is: .container-fluid{ width: 105% } The problem n

Bootstrap container fluid is not the full width of the screen

Blaze 26 I'm working on a website and I'm going to start with a mobile stylesheet first. But the width of the container fluid is not the same as the width of the window. The way I am trying to fix this is: .container-fluid{ width: 105% } The problem n

Bootstrap container fluid is not the full width of the screen

Blaze 26 I'm working on a website and I'm going to start with a mobile stylesheet first. But the width of the container fluid is not the same as the width of the window. The way I am trying to fix this is: .container-fluid{ width: 105% } The problem n

Container fluid not full screen width

sim card My container fluid element has a margin below the right for all screen sizes and a scrollbar at the bottom. i don't want this This question has been asked before, but none of the answers worked for me. Some of the previous posts didn't seem to help so

Container fluid not full screen width

sim card My container fluid element has a margin below the right on all screen sizes and a scrollbar at the bottom. i don't want this This question has been asked before, but none of the answers worked for me. Some of the previous posts didn't seem to help som

Container fluid not full screen width

sim card My container fluid element has a margin below the right on all screen sizes and a scrollbar at the bottom. i don't want this This question has been asked before, but none of the answers worked for me. Some of the previous posts didn't seem to help som

Container fluid not full screen width

sim card My container fluid element has a margin below the right for all screen sizes and a scrollbar at the bottom. i don't want this This question has been asked before, but none of the answers worked for me. Some of the previous posts didn't seem to help so

Container fluid not full screen width

sim card My container fluid element has a margin below the right for all screen sizes and a scrollbar at the bottom. i don't want this This question has been asked before, but none of the answers worked for me. Some of the previous posts didn't seem to help so

How to insert col-md-12 inside col-md-2 with full width

not any I inserted a row (col-md-12) div inside the col-md-2 div. I want the row div to take up the full width of the page. But it only takes the width of the parent col-md-2. How can I overcome this problem in a guided way? <div class="options-main row">

Container fluid doesn't take full width except navbar

its ashley .container-fluid-1 { padding: 0; } .navbar { padding: 0 5%; } .navbar-section{ background-color: #fff; width: 100%; padding: 0 1%; margin: 0; position: fixed; z-index: 1; } .nav-item { padding: 0 20px; } .nav-link { color: b

Bootstrap col-xs-12 in HTML not showing full width

Albemarle I've created a simple button link using the container-fluidand rowclass on a webpage so that I can utilize the entire available width of the page as a link button. However, my code doesn't cause the button to take up the full width of the page. Attac

I can't get the div to take the full width of the screen

ACSND No matter what I try, there is still a visible margin between the div and the top/right/left of the screen. <!DOCTYPE html> <html> <head> <title>Test2</title> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootst

I can't get the div to take the full width of the screen

ACSND No matter what I try, there is still a visible margin between the div and the top/right/left of the screen. <!DOCTYPE html> <html> <head> <title>Test2</title> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootst

I can't get the div to take the full width of the screen

ACSND No matter what I try, there is still a visible margin between the div and the top/right/left of the screen. <!DOCTYPE html> <html> <head> <title>Test2</title> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootst

I can't get the div to take the full width of the screen

ACSND No matter what I try, there is still a visible margin between the div and the top/right/left of the screen. <!DOCTYPE html> <html> <head> <title>Test2</title> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootst

I can't get the div to take the full width of the screen

ACSND No matter what I try, there is still a visible margin between the div and the top/right/left of the screen. <!DOCTYPE html> <html> <head> <title>Test2</title> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootst

I can't get the div to take the full width of the screen

ACSND No matter what I try, there is still a visible margin between the div and the top/right/left of the screen. <!DOCTYPE html> <html> <head> <title>Test2</title> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootst

I can't get the div to take the full width of the screen

ACSND No matter what I try, there is still a visible margin between the div and the top/right/left of the screen. <!DOCTYPE html> <html> <head> <title>Test2</title> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootst