Divs with float right without its inverted position

Asked

Viewed 425 times

3

I’d like to know how to ensure that two DIV, both with float:right, do not reverse the position of each other, for example:

<div id="divMaster">

    <div class="pull-right" id="Div1">    
    </div>

    <div class="pull-right" id="Div2">
    </div>

</div>

Whereas the #Div1 continue to the left of #Div2.

Obs:
pull-right is a Twitter Bootstrap class, but it’s the same as the float:right;.

  • You can always change the order of the div’s and it’s straight as you want it.

1 answer

5


You can make use of a wrapper:

Example in Jsfiddle

<div id="divMaster">
    <div class="pull-right">
      <div class="pull-left" id="Div1"></div>
      <div class="pull-left" id="Div2"></div>
    </div>
</div>
  • Vlw, it worked here @Zuul!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.