Problem with grid bootstrap

1

<!carousel--><divclass="container bg-danger">
<div class="row">
          <div class=".col-4 mt-3 mr-4">
        <div class="boxonee ">teste xd</div>

      </div>
 <div class=".col-4">
 <div id="carouselExampleCaptions" class="carousel slide mt-3 " data-ride="carousel">
                <ol class="carousel-indicators">
                  <li data-target="#carouselExampleCaptions" data-slide-to="0" class=""></li>
                  <li data-target="#carouselExampleCaptions" data-slide-to="1" class=""></li>
                  <li data-target="#carouselExampleCaptions" data-slide-to="2" class="active"></li>
                </ol>
                <div class="carousel-inner" role="listbox">
                  <div class="carousel-item">
                    <img class="d-block img-fluid" data-src="holder.js/800x400?auto=yes&amp;bg=777&amp;fg=555&amp;text=First slide" alt="" src="images/sd1.png" data-holder-rendered="true"> 
                  </div>
                  <div class="carousel-item">
                    <img class="d-block img-fluid" data-src="holder.js/800x400?auto=yes&amp;bg=666&amp;fg=444&amp;text=Second slide" alt="" src="images/sd2.png" data-holder-rendered="true">
                  </div>
                  <div class="carousel-item active">
                    <img class="d-block img-fluid" data-src="holder.js/800x400?auto=yes&amp;bg=555&amp;fg=333&amp;text=Third slide" alt="" src="images/sd1.png" data-holder-rendered="true">
                  </div>
               </div> 
              </div>
  </div>
      <div class=".col-4">
        <div class="boxone mt-3 ml-4">teste 1</div>
        <div class="boxone  mt-3 ml-4">teste 2</div>
          <div class="boxone mt-3 ml-4">teste 2</div>
      </div>
</div>
</div>

css:

body {
    margin:0;
    padding:0;
    background:#e84118;
}

img.logo{
    width: 250px;
    height: 70px;
}
.prodf {
    display:flex
}
.form-control-borderless {
    border: none;
}

.form-control-borderless:hover, .form-control-borderless:active, .form-control-borderless:focus {
    border: none;
    outline: none;
    box-shadow: none;
}
.minhaconta{
    margin-top: 10px;
}
.dropspc{
    background: #000;
}
/* actual dropdown animation */
.dropdown .dropdown-menu {
    -webkit-transition: all 0.3s;
    -moz-transition: all 0.3s;
    -ms-transition: all 0.3s;
    -o-transition: all 0.3s;
    transition: all 0.3s;

    max-height: 0;
    display: block;
    overflow: hidden;
    opacity: 0;
}

.dropdown.open .dropdown-menu {
    max-height: 400px;
    background: #000;
    width: 200px;
    opacity: 1;
}
.boxone{
    width: 270px;
    height: 150px;
    background: #000;
}
.boxonee{
    width: 270px;
    height: 150px;
    background: #000;
}
/*import*/
.xd .carousel-item {
    overflow: hidden;
    width: 100%;
    height: 100%; /* aqui vc ajusta a altura do slider */
}
.xd .carousel-item img {
    width: 100%;
    /* transform: translateY(-50%)  habilitar se quiser pocicionar o meio da imagem no slider*/
}
/*import*/

I'm having this issue with these grid I'm trying to use the ml-4 and the boxes are coming down.

    
asked by anonymous 01.10.2018 / 16:59

1 answer

1

You are using the class name in the wrong way, it is not .col-4 , you should not use this . is just col-4

Another problem is that you are using mr-4 , this is helping your grid to break ... replace with pr-4 (mr = margin-right / pr = padding-right). You have to do the responsive part of the Grid for small screens, determining how many column the content will occupy for each screen size. Type col-6 col-md-4 This means that even medium screens occupy 4 columns (33.3% of screen width), and on smaller screens this takes up 6 columns (50% of screen width)

Here in the snipper is not cool because the screen is very small, see how it is:

OBS: It would be nice to take a break in development and take a quick look at the Grif documentation link , look for tb on YouTube, there's a lot of stuff on how to understand Grid and how it works! After you understand this you will never have any problem with these layout ... From a searched there it will help you.

body {
      margin: 0;
      padding: 0;
      background: #e84118;
    }

    img.logo {
      width: 250px;
      height: 70px;
    }

    .prodf {
      display: flex
    }

    .form-control-borderless {
      border: none;
    }

    .form-control-borderless:hover,
    .form-control-borderless:active,
    .form-control-borderless:focus {
      border: none;
      outline: none;
      box-shadow: none;
    }

    .minhaconta {
      margin-top: 10px;
    }

    .dropspc {
      background: #000;
    }

    /* actual dropdown animation */
    .dropdown .dropdown-menu {
      -webkit-transition: all 0.3s;
      -moz-transition: all 0.3s;
      -ms-transition: all 0.3s;
      -o-transition: all 0.3s;
      transition: all 0.3s;

      max-height: 0;
      display: block;
      overflow: hidden;
      opacity: 0;
    }

    .dropdown.open .dropdown-menu {
      max-height: 400px;
      background: #000;
      width: 200px;
      opacity: 1;
    }

    .boxone {
      width: 270px;
      height: 150px;
      background: #000;
    }

    .boxonee {
      width: 270px;
      height: 150px;
      background: #000;
    }

    /*import*/
    .xd .carousel-item {
      overflow: hidden;
      width: 100%;
      height: 100%;
      /* aqui vc ajusta a altura do slider */
    }

    .xd .carousel-item img {
      width: 100%;
      /* transform: translateY(-50%)  habilitar se quiser pocicionar o meio da imagem no slider*/
    }

    /*import*/
  <link rel="stylesheet" type="text/css" media="screen" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" />
  <script src="https://code.jquery.com/jquery-3.2.1.min.js"></script><scriptsrc="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>
  

    

  <! carousel-->
  <div class="container bg-danger">
    <div class="row">
      <div class="col-4 mt-3 pr-4">
        <div class="boxonee ">teste xd</div>

      </div>
      <div class="col-4">
        <div id="carouselExampleCaptions" class="carousel slide mt-3 " data-ride="carousel">
          <ol class="carousel-indicators">
            <li data-target="#carouselExampleCaptions" data-slide-to="0" class=""></li>
            <li data-target="#carouselExampleCaptions" data-slide-to="1" class=""></li>
            <li data-target="#carouselExampleCaptions" data-slide-to="2" class="active"></li>
          </ol>
          <div class="carousel-inner" role="listbox">
            <div class="carousel-item">
              <img class="d-block img-fluid" data-src="holder.js/800x400?auto=yes&amp;bg=777&amp;fg=555&amp;text=First slide"
                alt="" src="https://placecage.com/100/100"data-holder-rendered="true">
            </div>
            <div class="carousel-item">
              <img class="d-block img-fluid" data-src="holder.js/800x400?auto=yes&amp;bg=666&amp;fg=444&amp;text=Second slide"
                alt="" src="https://placecage.com/100/100"data-holder-rendered="true">
            </div>
            <div class="carousel-item active">
              <img class="d-block img-fluid" data-src="holder.js/800x400?auto=yes&amp;bg=555&amp;fg=333&amp;text=Third slide"
                alt="" src="https://placecage.com/100/100"data-holder-rendered="true">
            </div>
          </div>
        </div>
      </div>
      <div class="col-4">
        <div class="boxone mt-3 ml-4">teste 1</div>
        <div class="boxone  mt-3 ml-4">teste 2</div>
        <div class="boxone mt-3 ml-4">teste 2</div>
      </div>
    </div>
  </div>
    
01.10.2018 / 17:19