简体   繁体   中英

In the following CSS layout how can I make my arrow right aligned?

I have a mockup here

http://jsfiddle.net/pJCfE/

At the moment the down arrow is sitting next to 'All Services'. I would like to make it right aligned. How can I do this?

Add class "pull-right" to the caret

<span class="caret pull-right">

It's one of the utility classes included in bootstrap: https://github.com/twitter/bootstrap/blob/master/less/utilities.less

I lack of reputation for commenting best answer, but I have simple clarification in case "it doesn't stay vertically in the middle when using pull-right (float)". Solution is:

<span class="pull-right">
        <span class="caret"></span>
    </span>

Previous answer doesn't keep carte's vertical align, as @Omu says. Instead, you should extend .caret's css class:

.caret {
  position: absolute;
  right: 1%;
  top: 45%;
}

Check it out >> https://jsfiddle.net/twtvcx4n/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM