Course contentsShow
← Web Development
Lesson 458 of 2,9828. Advanced CSS Selectors and FeaturesFree lesson

Block and Inline Axes

Learn the difference between block (vertical) and inline (horizontal) directions in default flow, and how they change.

Block and Inline Axes

You'll learn how content flows in two different directions and why understanding these axes matters for modern CSS.

The Two Directions of Flow

When you write CSS, content doesn't just flow in one direction—it flows along two axes: the block axis and the inline axis.

In English and most Western languages (default flow):

  • The block axis runs vertically (top to bottom) — like stacking blocks or paragraphs
  • The inline axis runs horizontally (left to right) — like words in a sentence

Think of reading a book: your eyes move along the inline direction word-by-word across a line, then jump down the block direction to the next line.

Why These Terms Exist

Traditional CSS properties like margin-top and padding-left assume left-to-right, top-to-bottom writing. But not all languages work this way! Japanese can flow top-to-bottom (block) and right-to-left (inline). Arabic flows right-to-left inline.

By understanding block and inline as concepts rather than "vertical" and "horizontal," you prepare yourself for logical properties that adapt to different writing modes automatically.

Defaults to Remember

/* In default (English) flow: */
/* Block axis = vertical direction */
/* Inline axis = horizontal direction */

When you see properties with block or inline in their names (coming in logical properties), they refer to these conceptual directions, not fixed physical directions.

Key Takeaway: The block axis (vertical in English) is where elements stack, and the inline axis (horizontal in English) is where content flows within a line—but these directions can change based on writing mode.