Axel
Axel

Reputation: 5141

How to push the div next to the end of row in bootstrap?

I have a markup like this:

<div class="wrapper">
    <div class="row">
        <div class="col-md-4"></div>
    </div>
    <div class="next-to-div"></div>
</div>

I want to place div.next-to-div just next to div.col-md-4. If I use this markup, then obviously it will place that div to a new line. Please help!

Upvotes: 0

Views: 752

Answers (2)

Carol Skelly
Carol Skelly

Reputation: 362820

You could make the container d-flex and use justify-content-between to separate the divs...

<div class="wrapper container-fluid d-flex justify-content-between">
    <div class="row flex-grow-1">
        <div class="col-md-4">col 4</div>
    </div>
    <div class="next-to-div">next dov</div>
</div>

https://www.codeply.com/go/F3r1GeXCoF

Upvotes: 0

Tom
Tom

Reputation: 870

Place your div.next-to-div in div.row

<div class="wrapper">
    <div class="row">
        <div class="col-md-4"></div>
        <div class="next-to-div"></div>
    </div>
</div>

Upvotes: 1

Related Questions