Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Bootstrap Columns not moving to the right and instead staying below each other

So I’m coding a website homepage and I try to make another column, yet it wont move to the right, I’ve even tried to justify it to the right which doesnt work.

I want it to be specifically to the right of the col-md-6 but instead it shows below it

HTML Code below.
I want the col-md-4 to be to the right of col-md-6 but instead it shows below col-md-6

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

<body>
    <div class="row">

        <div class="container-fluid">
            <div class="col-16 bg-dark order-1">
                <div class="d-flex justify-content-center"><h1 class="text-white">Welcome to the Website</h1></div>
            </div>
            <div class="col-md-6 bg-dark order-2">
                <div class="justify-content-center">
                    <h1 class="text-white">Rate our website</h1>
                </div>
                <div class="justify-content-between">
                    <button onclick="increasenumber()" id="coolbutton" type="button" class="btn btn-success">Upvote</button>
                    <button onclick="decreasenumber()" id="coolbutton1" type="button" class="btn btn-danger">Downvote</button>
                    <button onclick="resetcount()"id="coolbutton2" type="button" class="btn btn-info">Reset</button>
                </div>
                <div class="justify-content-center">
                    <h1 class="text-white" id="counter">0</h1>
                </div>
                
            </div>
            <div class="col-md-4 bg-dark">

            </div>
    </div>



</body>

I attempted to use justify content right with a d-flex but that just shifted it right and not where I wanted it, I also tried using the bootstrap native order class but that didn’t really work either

>Solution :

You have an extra <div class="container-fluid"> that is interfering with the row. If you just remove it everything will fall into place.
You will also need to remove the order-x classes.

<body>
  <div class="row">

    <div class="col-16 bg-dark">
      <div class="d-flex justify-content-center">
        <h1 class="text-white">Welcome to the Website</h1>
      </div>
    </div>
    <div class="col-md-6 bg-dark">
      <div class="justify-content-center">
        <h1 class="text-white">Rate our website</h1>
      </div>
      <div class="justify-content-between">
        <button onclick="increasenumber()" id="coolbutton" type="button" class="btn btn-success">Upvote</button>
        <button onclick="decreasenumber()" id="coolbutton1" type="button" class="btn btn-danger">Downvote</button>
        <button onclick="resetcount()" id="coolbutton2" type="button" class="btn btn-info">Reset</button>
      </div>
      <div class="justify-content-center">
        <h1 class="text-white" id="counter">0</h1>
      </div>

    </div>
    <div class="col-md-4 bg-dark">

    </div>
  </div>

</body>
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading