On this page
  1. float
  2. Syntax & Overview
  3. Notes & Best Practices
  4. Example

float

Prev: `gap` | Up: layout | Next: box_model
Rel: display (flex/grid), layout, Display & Layout Guide
Ref: MDN Web Docs — float
Tags: #public #web #css #properties #layout #tier/legacy


Syntax & Overview

float: left | right | none;

Pulls an element out of normal flow so inline text wraps around it.

Legacy / Avoid: Prefer display (flex/grid) for modern layouts.

Notes & Best Practices

Example

.article { display: flow-root; }
.article img.pull { float: inline-start; margin-inline-end: 1rem; max-width: 12rem; }

Linked from

Related notes