title: Bootstrap 4 row extends outside of container
body: <p>I am working on a simple website for my boss. I decided to try using bootstrap and opted for version 4. So I have a pretty good template structured out and noticed that the row for the main content extends out past the bounds of the container div. It is the only row on the page that does that. I tried changing spacing with margin or padding on either/both elements and it didn't seem to change anything. I also tried containing the main content inside of a section tag, since the other two rows are contained within header/footer tags and they remain within the bounds. This also did not work. I am probably missing something obvious here. Thank you for any help, I appreciate it.</p>
  <p><img src="https://i.stack.imgur.com/mSnw0.png" alt="screenshot" /></p>
  <p>I highlighted the container just to show its bounding box. I also have the padding removed from it in this screenshot, it is the same problem either way though.</p>
  <pre><code>    &lt;!doctype html&gt;
  &lt;html lang=&quot;en&quot;&gt;
    &lt;head&gt;
      &lt;title&gt;Air Technology West&lt;/title&gt;
      &lt;!-- Required meta tags --&gt;
      &lt;meta charset=&quot;utf-8&quot;&gt;
      &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1, shrink-to-fit=no&quot;&gt;
  
      &lt;!-- fontawesome CDN embed --&gt;
      &lt;script src=&quot;https://use.fontawesome.com/f13a1bd68c.js&quot;&gt;&lt;/script&gt;
  
      &lt;!-- Bootstrap CSS --&gt;
      &lt;link rel=&quot;stylesheet&quot; href=&quot;https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/css/bootstrap.min.css&quot; integrity=&quot;sha384-PsH8R72JQ3SOdhVi3uxftmaW6Vc51MKb0q5P2rRUpPvrszuE4W1povHYgTpBfshb&quot; crossorigin=&quot;anonymous&quot;&gt;
      &lt;link rel=&quot;stylesheet&quot; href=&quot;css/style.css&quot;&gt;
  
    &lt;/head&gt;
    &lt;body&gt;
      &lt;div class=&quot;container&quot;&gt;
        &lt;!-- Header area --&gt;
        &lt;header class=&quot;pt-3 px-3&quot;&gt;
          &lt;div class=&quot;row&quot;&gt;
            &lt;div class=&quot;col-md-6&quot;&gt;
              &lt;a href=&quot;#&quot;&gt;&lt;img class=&quot;logo&quot; src=&quot;img/logo1.png&quot;&gt;&lt;/a&gt;
            &lt;/div&gt;
  
            &lt;div class=&quot;col-md-6&quot;&gt;
              &lt;ul class=&quot;contact-info&quot;&gt;
                &lt;li class=&quot;ph-local&quot;&gt;&lt;i class=&quot;fa fa-phone fa-fw&quot;&gt;&lt;/i&gt; xxx-xxx-xxxx&lt;/li&gt;
                &lt;li class=&quot;ph-fax&quot;&gt;&lt;span class=&quot;fnt-sm&quot;&gt;Fax: &lt;/span&gt;&lt;i class=&quot;fa fa-fax fa-fw&quot;&gt;&lt;/i&gt; xxx-xxx-xxxx&lt;/li&gt;
              &lt;/ul&gt;
            &lt;/div&gt;
          &lt;/div&gt;&lt;!--END ROW--&gt;
      &lt;/header&gt;
  
      &lt;nav class=&quot;navbar navbar-expand-md nav-main d-flex flex-row&quot;&gt;
        &lt;button class=&quot;navbar-toggler&quot; type=&quot;button&quot; data-toggle=&quot;collapse&quot; data-target=&quot;#nav-main-toggle&quot; aria-controls=&quot;nav-main-toggle&quot; aria-expanded=&quot;false&quot; aria-label=&quot;Toggle navigation&quot;&gt;
      &lt;span class=&quot;fa fa-bars fa-2x&quot;&gt;&lt;/span&gt;&lt;span class=&quot;btn-collapse&quot;&gt; MENU&lt;/span&gt;
    &lt;/button&gt;
        &lt;div class=&quot;collapse navbar-collapse&quot; id=&quot;nav-main-toggle&quot;&gt;
          &lt;div class=&quot;nav navbar-nav mr-auto&quot;&gt;
            &lt;p class=&quot;nav-item&quot;&gt;&lt;a class=&quot;nav-link px-3&quot; href=&quot;#&quot;&gt;Home&lt;/a&gt;&lt;/p&gt;
            &lt;p class=&quot;nav-item&quot;&gt;&lt;a class=&quot;nav-link px-3&quot; href=&quot;#&quot;&gt;About Us&lt;/a&gt;&lt;/p&gt;
            &lt;li class=&quot;nav-item dropdown&quot;&gt;
              &lt;a class=&quot;nav-link dropdown-toggle&quot; data-toggle=&quot;dropdown&quot; aria-haspopup=&quot;true&quot; aria-expanded=&quot;false&quot;&gt;Products&lt;/a&gt;
              &lt;div class=&quot;dropdown-menu&quot;&gt;
                &lt;a class=&quot;dropdown-item&quot; href=&quot;#&quot;&gt;Compressors&lt;/a&gt;
                &lt;a class=&quot;dropdown-item&quot; href=&quot;#&quot;&gt;Spray Equipment&lt;/a&gt;
                &lt;a class=&quot;dropdown-item&quot; href=&quot;#&quot;&gt;Parts &amp; Accessories&lt;/a&gt;
                &lt;a class=&quot;dropdown-item&quot; href=&quot;#&quot;&gt;All Major Products&lt;/a&gt;
              &lt;/div&gt;
            &lt;/li&gt;
            &lt;p class=&quot;nav-item&quot;&gt;&lt;a class=&quot;nav-link px-3&quot; href=&quot;#&quot;&gt;Services&lt;/a&gt;&lt;/p&gt;
            &lt;p class=&quot;nav-item&quot;&gt;&lt;a class=&quot;nav-link px-3&quot; href=&quot;#&quot;&gt;Contact Us&lt;/a&gt;&lt;/p&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/nav&gt;
  
      &lt;!--===========END header area==============--&gt;
  
      &lt;!--===========CAROUSEL area================--&gt;
      &lt;div id=&quot;carousel-main&quot; class=&quot;carousel slide&quot; data-ride=&quot;carousel&quot;&gt;
        &lt;ol class=&quot;carousel-indicators&quot;&gt;
          &lt;li data-target=&quot;#carousel-main&quot; data-slide-to=&quot;0&quot; class=&quot;active&quot;&gt;&lt;/li&gt;
          &lt;li data-target=&quot;#carousel-main&quot; data-slide-to=&quot;1&quot;&gt;&lt;/li&gt;
          &lt;li data-target=&quot;#carousel-main&quot; data-slide-to=&quot;2&quot;&gt;&lt;/li&gt;
        &lt;/ol&gt;
        &lt;div class=&quot;carousel-inner&quot;&gt;
          &lt;div class=&quot;carousel-item active&quot;&gt;
            &lt;a href=&quot;#&quot;&gt;&lt;img class=&quot;d-block w-100&quot; src=&quot;img/headline_compressors.PNG&quot; alt=&quot;First slide&quot;&gt;&lt;/a&gt;
          &lt;/div&gt;
  
          &lt;div class=&quot;carousel-item&quot;&gt;
            &lt;a href=&quot;#&quot;&gt;&lt;img class=&quot;d-block w-100&quot; src=&quot;img/headline_spray.PNG&quot; alt=&quot;Second slide&quot;&gt;&lt;/a&gt;
          &lt;/div&gt;
  
          &lt;div class=&quot;carousel-item&quot;&gt;
            &lt;a href=&quot;#&quot;&gt;&lt;img class=&quot;d-block w-100&quot; src=&quot;http://via.placeholder.com/720x300&quot; alt=&quot;Third slide&quot;&gt;&lt;/a&gt;
          &lt;/div&gt;
        &lt;/div&gt;&lt;!--END CAROUSEL INNER--&gt;
        &lt;a class=&quot;carousel-control-prev&quot; href=&quot;#carousel-main&quot; role=&quot;button&quot; data-slide=&quot;prev&quot;&gt;
          &lt;span class=&quot;carousel-control-prev-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;/span&gt;
          &lt;span class=&quot;sr-only&quot;&gt;Previous&lt;/span&gt;
        &lt;/a&gt;
        &lt;a class=&quot;carousel-control-next&quot; href=&quot;#carousel-main&quot; role=&quot;button&quot; data-slide=&quot;next&quot;&gt;
          &lt;span class=&quot;carousel-control-next-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;/span&gt;
          &lt;span class=&quot;sr-only&quot;&gt;Next&lt;/span&gt;
        &lt;/a&gt;
      &lt;/div&gt;
      &lt;!--===========END carousel area============--&gt;
  
      &lt;!--===========PAGE content==============--&gt;
      &lt;section id=&quot;page-content&quot;&gt;
        &lt;div class=&quot;row&quot;&gt;
          &lt;aside class=&quot;col-md-3&quot;&gt;
            &lt;div class=&quot;card mt-3&quot;&gt;
              &lt;a href=&quot;#&quot;&gt;
                &lt;img class=&quot;card-img-top&quot; src=&quot;http://via.placeholder.com/200x200&quot; alt=&quot;Card image cap&quot;&gt;
                &lt;div class=&quot;card-body&quot;&gt;
                  &lt;p class=&quot;card-text&quot;&gt;Service&lt;/p&gt;
                &lt;/div&gt;
              &lt;/a&gt;
            &lt;/div&gt;
  
            &lt;div class=&quot;card mt-3&quot;&gt;
              &lt;a href=&quot;#&quot;&gt;
                &lt;img class=&quot;card-img-top&quot; src=&quot;http://via.placeholder.com/200x200&quot; alt=&quot;Card image cap&quot;&gt;
                &lt;div class=&quot;card-body&quot;&gt;
                  &lt;p class=&quot;card-text&quot;&gt;Products&lt;/p&gt;
                &lt;/div&gt;
              &lt;/a&gt;
            &lt;/div&gt;
  
            &lt;div class=&quot;card mt-3&quot;&gt;
              &lt;a href=&quot;#&quot;&gt;
                &lt;img class=&quot;card-img-top&quot; src=&quot;http://via.placeholder.com/200x200&quot; alt=&quot;Card image cap&quot;&gt;
                &lt;div class=&quot;card-body&quot;&gt;
                  &lt;p class=&quot;card-text&quot;&gt;Parts &amp; accessories&lt;/p&gt;
                &lt;/div&gt;
              &lt;/a&gt;
            &lt;/div&gt;
          &lt;/aside&gt;
  
          &lt;article class=&quot;main col-md-9 col-sm-12 px-3 mt-3&quot;&gt;
            &lt;p&gt;This is the main content area&lt;/p&gt;
          &lt;/article&gt;
        &lt;/div&gt;&lt;!--END ROW--&gt;
      &lt;/section&gt;&lt;!--END PAGE CONTENT--&gt;
      &lt;!--============END page content===============--&gt;
  
      &lt;!--=============footer area===============--&gt;
      &lt;footer class=&quot; my-3 px-3&quot;&gt;
        &lt;div class=&quot;row&quot;&gt;
  
          &lt;div class=&quot;col-sm-6&quot;&gt;
            &lt;h3 class=&quot;border-bottom&quot;&gt;Quick links&lt;/h3&gt;
            &lt;nav class=&quot;nav row nav-footer&quot;&gt;
              &lt;a class=&quot;nav-link col-md-4 col-sm-6&quot; href=&quot;#&quot;&gt;Products&lt;/a&gt;
              &lt;a class=&quot;nav-link col-md-4 col-sm-6&quot; href=&quot;#&quot;&gt;Services&lt;/a&gt;
              &lt;a class=&quot;nav-link col-md-4 col-sm-6&quot; href=&quot;#&quot;&gt;About Us&lt;/a&gt;
              &lt;a class=&quot;nav-link col-md-4 col-sm-6&quot; href=&quot;#&quot;&gt;Contact Info&lt;/a&gt;
              &lt;a class=&quot;nav-link col-md-4 col-sm-6&quot; href=&quot;#&quot;&gt;Directons&lt;/a&gt;
              &lt;a class=&quot;nav-link col-md-4 col-sm-6&quot; href=&quot;#&quot;&gt;Site Map&lt;/a&gt;
            &lt;/nav&gt;
          &lt;/div&gt;
  
          &lt;div class=&quot;col-sm-6 contact-info&quot;&gt;
            &lt;h3 class=&quot;border-bottom&quot;&gt;Contact Info&lt;/h3&gt;
            &lt;p class=&quot;ph-local&quot;&gt;&lt;i class=&quot;fa fa-phone fa-fw&quot;&gt;&lt;/i&gt; xxx-xxx-xxxx&lt;/p&gt;
            &lt;p class=&quot;ph-fax&quot;&gt;&lt;span class=&quot;fnt-sm&quot;&gt;Fax: &lt;/span&gt;&lt;i class=&quot;fa fa-fax fa-fw&quot;&gt;&lt;/i&gt; xxx-xxx-xxxx&lt;/p&gt;
            &lt;p class=&quot;address&quot;&gt;&lt;i class=&quot;fa fa-map-marker fa-fw&quot;&gt;&lt;/i&gt; ADDRESS&lt;/p&gt;
          &lt;/div&gt;
  
        &lt;/div&gt;&lt;!--END ROW--&gt;
      &lt;/footer&gt;
      &lt;!--==============END footer area================--&gt;
  
    &lt;/div&gt;&lt;!--===============END CONTAINER===============--&gt;
  
      &lt;!-- Optional JavaScript --&gt;
      &lt;!-- jQuery first, then Popper.js, then Bootstrap JS --&gt;
      &lt;script src=&quot;https://code.jquery.com/jquery-3.2.1.slim.min.js&quot; integrity=&quot;sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN&quot; crossorigin=&quot;anonymous&quot;&gt;&lt;/script&gt;
      &lt;script src=&quot;https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.3/umd/popper.min.js&quot; integrity=&quot;sha384-vFJXuSJphROIrBnz7yo7oB41mKfc8JzQZiCq4NCceLEaO4IHwicKwpJf9c9IpFgh&quot; crossorigin=&quot;anonymous&quot;&gt;&lt;/script&gt;
      &lt;script src=&quot;https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/js/bootstrap.min.js&quot; integrity=&quot;sha384-alpBpkh1PFOepccYVYDB4do5UnbKysX5WZXm3XxPqe5iKTfUKjNkCk9SaVuEZflJ&quot; crossorigin=&quot;anonymous&quot;&gt;&lt;/script&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  <p>Edit: add styles.css file.</p>
  <pre><code>html{
    font-family: verdana, helvetica, sans-serif !important;
  }
  
  nav a{
    color: black;
    list-style: none;
    text-align: center;
    text-transform: uppercase;
  }
  
  .nav .nav-link, .nav .dropdown-item {
    color: black;
  }
  
  .dropdown-toggle{
    color: black;
  }
  
  .nav a:hover{
    border-bottom: 3px solid black;
    margin-bottom: -3px;
  }
  
  .nav a:active{
    background-color: grey;
    color: white;
  }
  
  .navbar{
    padding: .1rem;
  }
  
  .navbar-toggler{
    margin-left:auto;
    margin-right: auto;
  }
  /*********************3. LAYOUT********************/
  #carousel-main{
    position:relative;
  }
  
  .carousel-button-right{
    position: absolute;
    bottom: 2rem;
    right: 25%;
  }
  
  .carousel-button-left{
    position: absolute;
    bottom: 2rem;
    left: 25%;
  }
  
  .carousel-button-center{
    position: absolute;
    bottom: 30px;
    right: 50%;
  }
  /*********************4. MODULES*******************/
  
  /********4.1 HEADER *********/
  .logo{
    height: auto;
    max-width: 100%;
  }
  
  .contact-info{
    list-style: none;
    text-align: right;
  }
  
  .fnt-sm{
    font-size: .75rem;
  }
  
  .ph-local{
    font-size: 1.75rem;
  }
  
  /********4.2 MAIN NAV********/
  
  .btn-collapse{
    font-size: 2.2rem;
    font-weight: bold;
  }
  
  /********FOOTER********/
  
  .border-bottom{
    border-bottom: 1px solid black;
  }
  
  /*********************5. STATES********************/
  
  /*********************6. THEME*********************/
  
  body{
    background-image: url(&quot;../img/escheresque_ste.png&quot;);
    background-repeat: repeat;
  }
  
  header, footer, .navbar, .main{
    background-color: white;
  }
  
  @media (max-width: 767px) {
    header *{
      text-align:center;
    }
  
    nav .nav-item{
      text-align: center;
    }
  
  
    aside{
      display: none;
    }
  }
  
  @media (max-width: 575px) {
    footer *{
      text-align: center;
    }
  
    footer nav .nav-item{
      text-align: center;
    }
  
  }
  
  @media (min-width: 576px) {
    footer.contact-info *{
      text-align: right;
    }
  }
  </code></pre>