Course contentsShow
← Web Development
Lesson 243 of 2,9824. CSS Layout FoundationsFree lesson

When Floats Are Still Appropriate

Identifying legitimate modern use cases like text wrapping around images within content areas.

When Floats Are Still Appropriate

You'll learn: Where floats remain the best tool in modern CSS despite newer layout methods like Flexbox and Grid.

Floats Haven't Disappeared Completely

Even though floats are outdated for page layout, they still excel at one specific task: wrapping text around content, especially images. This is their original design purpose, and no modern layout method handles it better.

When you want text to flow naturally around an image within a paragraph or article—like in a magazine or newspaper—float is still the right choice. Flexbox and Grid are designed for structured layouts (rows, columns, grids), not for letting content organically wrap around obstacles.

The Magazine Article Pattern

Imagine you're writing a blog post with several paragraphs. You want an image to sit within the text, with words flowing around it on the right side. Float the image left, and the text behaves naturally—wrapping around the image's shape, then continuing below it when space runs out.

This is content-level layout, not page-level layout. You're styling within a content area (like an article or product description), not building the overall page structure.

When to Choose Float

Use float when:

  • You want text to wrap around an image or small graphic within flowing content
  • You're styling article or blog post content
  • The wrapped element is part of the document's natural flow, not a positioned layout component

Don't use float for:

  • Multi-column page layouts (use Grid or Flexbox)
  • Navigation bars or headers (use Flexbox)
  • Card layouts or galleries (use Grid)

Key Takeaway: Floats remain appropriate for their original purpose—wrapping text around images within content areas—while Flexbox and Grid handle structural page layouts.