left up right
Float Rules

Assume that the current box is to be floated left (similar rules for float:right):

  1. The left edge may not be to the left of the left edge of its containing block
  2. If previous boxes are left-floating, the left edge must be to the right of earlier boxes, or its top must be lower than the bottom of the earlier boxes
  3. The right edge may not be to the right of the left edge of any right-floating box that is to its right
  4. Its top may not be higher than the top of its containing block
  5. The top may not be higher than the top of any block generated by an element earlier in the document
  6. If there is a block to its left, its right edge cannot stick out to the right of its containing block's right edge
  7. It must be placed as high as possible
  8. It must be put as far to the left as possible
  9. If a decision has to be made with regard to leftness and height, the higher position is preferred