Align div right in Bootstrap 3

后端 未结 5 1463
刺人心
刺人心 2021-02-02 06:17

Is there a way in Bootstrap 3 to right align a div?

I am aware of the offsetting possibilitys but I want to align a formatted div to the right of its container while it

5条回答
  •  温柔的废话
    2021-02-02 06:43

    i think you try to align the content to the right within the div, the div with offset already push itself to the right, here some code and LIVE sample:
    FYI: .pull-right only push the div to the right, but not the content inside the div.

    HTML:

    left content
    right content

    CSS:

    .someclass{ /*this class for testing purpose only*/
        border:1px solid blue;
        line-height:2em;
    }
    
    .totheright{ /*this will align the text to the right*/
      text-align:right;
    }
    
    .yellow_background{
        background-color:yellow;
    }
    

    Another modification:

    ...
    
    right content
    image also align-right
    ...

    hope it will clear your problem

提交回复
热议问题