Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bootstrap Card Header: pull-right

How should i get my small text right aligned in a Bootstrap 4, Card Header?

HTML

<div class="container">
  <div class="row">
    <div class="col">
      <div class="card">
        <!--CARD HEADER-->
        <h4 class="card-header">HEADER <small class="pull-right">right aligned</small></h4>
        <!--CARD BODY-->
        <div class="card-body">
        </div>
      </div>
    </div>
  </div>

This is what i have tried:
https://jsfiddle.net/LL0qnnxm/60/

like image 271
Björn C Avatar asked Sep 12 '17 08:09

Björn C


People also ask

How do I align card side by side?

Make the card and the inner container flex-columns, then tell the container to xpand as much as possible with flex:1 . Then push the h4 to the bottom of the container with margin-top:auto . Save this answer.

How do you align cards side by side react Bootstrap?

You can do it simply using d-flex and flex fill react bootstrap class. It will also fulfill your need of equal height cards in a row.

How do I align Bootstrap cards horizontally?

The right thing would be for the cards to be horizontally aligned, how do I do this? use css - something like float:left;clear:none; applied to each card.


1 Answers

Use float-{sm,md,lg,xl}-right instead of pull-right because it changed in Bootstrap 4. For more info please read this https://v4-alpha.getbootstrap.com/migration/

And for your solution please check the updated Fiddle

like image 179
kravisingh Avatar answered Sep 18 '22 15:09

kravisingh