[ACCEPTED]-Float div's to the right in left-to-right order?-css

Accepted answer
Score: 88

You could apply a text-align: right to the container and 1 a display: inline-block in place of the floating:

<div style="text-align: right">
  <div style="display:inline-block">Left</div>
  <div style="display:inline-block">Middle</div>
  <div style="display:inline-block">Right</div>
</div>

DEMO

Score: 18

Using display:inline-block might not work as expected with elements 2 of variable height.

So you might want to 1 use:

<div style="float: right">
      <div style="float:left">Left</div>
      <div style="float:left">Middle</div>
      <div style="float:left">Right</div>
</div>

See: demo of both -- inline and float-float.

Score: 4

You could give float: right to the outer div. And the 1 display style of the inner div is inline-block

 <div style="float: right" >
      <div style="display:inline-block">Left</div>
      <div style="display:inline-block">Middle</div>
      <div style="display:inline-block">Right</div>
 </div>

More Related questions