CSS Layout Tutorial

By Xah Lee. Date: . Last updated: .

CSS has many ways to create layout and layers.

Here are the major methods.

Using Table Layout

Pure CSS Table

Flow Around Blocks

The float property can make text flow around a image or a block element.

See: CSS Text Flow Around Image

Using Margin

Margin can be used to create several columns or panes.

CSS: 3 Columns Page Layout

Multi-Column Layout

CSS: Multi-Column Layout for Text Flow

Create Layer

CSS Position: static, relative, fixed, absolute

Hide Element

A element can be hidden by:

These are useful especially when used together with JavaScript. For example, for collapsible list, popup tooltip.

[see JS: How to Create Tooltip]

Liket it? Put $5 at patreon.

Or, Buy JavaScript in Depth

Ask me question on patreon