How does one right-justify bootstrap pills with css


Tags: html,css,twitter-bootstrap

Problem :

I have a header with three sections, left, middle and right. I cant seem to come up with the proper css to make the column on the right (with 'email history' and 'back to list') float to the right side of the column. How can anyone tell me how this is done? Any help is appreciated.

<div class="col-sm-5" style="text-align:left">
    <button type="submit" class="btn btn-primary btn-lg navbar-btn">Save Contact</button>
</div>
<div class="col-sm-2" style="text-align:center">
   <h2 class="branding">Edit Contact</h2>
</div>
<div class="col-sm-5">
   <ul class="nav nav-pills">
      <li class="active"><a href="/GoHistory">Email History</a></li>
      <li class="active"><a href="/email_marketing/contact-list">Back To List</a></li>
   </ul>
</div>


Solution :

The easiest option is to add the class pull-right to the ul element. This will float the pills to the right.

Sidenote: you can replace those inline styles with the helper classes text-left (which is often redundant) and text-center.

Here's a bootply example: http://www.bootply.com/134139


    CSS Howto..

    php search result images show across and fill a CSS div

    How do I center this menu?

    how to solve css check box checking issue

    Sidebar, Navigation and Content how to do it?

    How do i select rows that correspond to a rowspan?

    How to set a background-color to element which has the same id with anchor of url?

    How to make flash movie to scale proportunatly to div width?

    How can images be resized using Bootstrap

    How to get the image height of an image to set another div height

    How to build a hover effect with css only, or css+jquery

    How to adjust width of a child element without adjusting the width of the parent in CSS?

    How to change css position left to right using jquery?

    How to retrieve the background image url defined in CSS?

    My sidebar is fixed no matter what. How do I make scrolling possible with the sidebar?

    How to change css file for this aim?

    How to achieve this view?

    How to test print output of browsers with online tools?

    JQuery: Creating boxed text that shows on top of a div on hover

    how to set size of canvas to its background image?

    How do i hide html until its processed with javascript?

    Shadow-Piercing descendant combinator, '/deep/' , including '::shadow' pseudo elements, are being deprecated so how do we pierce the Shadow DOM?

    How to use base css file using twig

    How to safely display user's text containing all html/css in rails 3

    how to overlap two div in css?

    How to add wikipedia in to a wordpress plugin

    How to load a apply jQuery function upon appending a
    via Ajax?

    How to position label text with css

    How can menu items be displayed from bottom up using CSS

    How to make space between menu items in CSS/HTML

    HTML/CSS/JS: How to force browser to save password from a non-'password' type input?