In the context of CSS, a Float is used to control the flow of text around an element (or vice versa). It is not to be confused with the floating-point data types that are encountered in programming languages like Java.

Float in CSS can be set for any boxed element which is not positioned as absolute. For example an image may be floated around text. The float property can be given one of the three values—left, right or none, implying whether it floats (the element) to the left, right or not applying floating at all. If the float is applied to several elements in a sequence, it keeps following the rule (of right or left) as per the previous element, thus elements can be stacked sideways (as long as there is space).

 <!DOCTYPE html PUBLIC ...

Get Web Technology: Theory and Practice now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.