Text-align class for inside a table

后端 未结 20 1243
灰色年华
灰色年华 2020-11-28 00:10

Is there a set of classes in Twitter\'s Bootstrap framework that aligns text?

For example, I have some tables with $ totals that I want aligned to the r

相关标签:
20条回答
  • 2020-11-28 01:08

    The .text-align class is totally valid and more usable than having a .price-label and .price-value which are of no use any more.

    I recommend going 100% with a custom utility class called

    .text-right {
      text-align: right;
    }
    

    I like to do some magic, but that is up to you, like something:

    span.pull-right {
      float: none;
      text-align: right;
    }
    
    0 讨论(0)
  • 2020-11-28 01:10

    Bootstrap 4 is coming! The utility classes made familiar in Bootstrap 3.x are now break-point enabled. The default breakpoints are: xs, sm, md, lg and xl, so these text alignment classes look something like .text-[breakpoint]-[alignnment].

    <div class="text-sm-left"></div> //or
    <div class="text-md-center"></div> //or
    <div class="text-xl-right"></div>
    

    Important: As of writing this, Bootstrap 4 is only in Alpha 2. These classes and how they're used are subject to change without notice.

    0 讨论(0)
提交回复
热议问题