float and clear

float takes an element out of normal flow and moves it to one side, so the text wraps around it. It used to build column layouts; today its natural use is wrapping text around an image.
  • float: left or right: the element moves to that side and inline content flows around it.
  • clear: prevents an element from sitting next to a float and moves it below.
  • A container does not grow to contain its floats; display: flow-root fixes that.
  • To place columns or cards use flex or grid: float is not meant for that.

Example

Change float on the item class and watch the text wrap around it on one side or the other.

Select float:
ResultLive
html
css