SystemTutor
About
Sign in
Loading course documentation…
SystemTutor

COURSES

  • Data Structures & Algorithms
  • CSS MasterclassNew course
  • System DesignNew course

PRACTICE

  • Algorithm practice
  • CSS practice

LEGAL

  • Privacy Policy
  • Terms of Service
  • About

© 2026 SystemTutor. All rights reserved.

Built with 🫶 by Shatlyk

Welcome to CSS
The Box Model and SizingWriting Modes and Logical PropertiesSizing ElementsBorders and ShadowsDisplay and Document FlowNormal FlowFloats and ColumnsPositioning and StackingStacking and Z-Index Measuring boxes and predicting their positions
Box Model and Flow

Writing Modes and Logical Properties

Map inline and block edges to the directions that text and successive lines follow.

The space before the first word of a paragraph can be on the left, the right, or the top. CSS can name that edge in relation to the text, so a spacing rule can follow the language and layout.

Follow a line, then follow the next line

The inline axis runs along a line of text. The block axis runs in the direction that successive lines stack. In an English paragraph with horizontal, left-to-right text, the first word begins at the left and each new line sits below the previous one.

Read a horizontal, right-to-left paragraph and the first word begins at the right. The next line still sits below. With the writing mode vertical-rl and left-to-right direction, a line reads down the page and the next line starts to its left. In that case the first line is at the right edge.

Horizontal lines run rightward in LTR and leftward in RTL, with new lines below. In vertical-rl with LTR direction, items run downward and the next column starts to the left.

Name the edge the design needs

padding-inline-start introduces space at the start of a line of text. In those three paragraphs, the added space appears on the left, right, and top respectively. A physical property such as padding-left always selects the left edge.

The same distinction applies to size. inline-size measures along a line, so it corresponds to width in horizontal writing and height in vertical writing. A limit on a paragraph’s inline size can keep its lines readable in either orientation.

Key Takeaways

  • Locate the start of a line and the start of the next line to identify both axes.
  • Logical sizes and spacing follow the element’s writing mode and direction.

Try it yourself

Try it yourself

Mark the start of each note

HTML + CSS

Loading code editor…

Live preview

Updating…

Final output

No comparison yetChecks after 3s without edits
Loading your draft…

How is this lesson?

Previous lessonThe Box Model and SizingNext lessonSizing Elements
Edit on GitHubReport on GitHub
On this page
%

On this page

Follow a line, then follow the next lineName the edge the design needsKey TakeawaysTry it yourself