Floats and Clears
Although a fresh new design will likely use the grid and flexbox tools described in the rest of this chapter to position elements, if you’re using Tailwind in a legacy project, you might still need to deal with floats and clearfixes.
In CSS, the float property positions content inside its container. Typically, the float property is used to position a particular element, often an image, to one side or the other of its container, allowing the rest of the container, often text, to stay completely on the other side, rather than mixing the elements together.
Tailwind provides float-left and float-right for positions, and float-none as a reset option.
The CSS clear property forces an element to be placed below any elements it might ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access