HTML float right element order

前端 未结 6 1453
难免孤独
难免孤独 2020-12-02 12:08

If I have three elements flaoted to right, why order is following (see jsfiddle) element 1 is first element on right side, when element 3 is actually last element.

O

6条回答
  •  南方客
    南方客 (楼主)
    2020-12-02 12:15

    Using float or any other css property has no effect on html source code.

    Any element that follows the floated element will flow around the floated element on the other side.

    If you float an image to the left, any text or other elements following it will flow around it to the right. And if you float an image to the right, any text or other elements following it will flow around it to the left.

提交回复
热议问题