← All 193 books css, one property per page
One property per page

css, one property per page

Twenty-four lessons on the properties of CSS: box-sizing, width, margin, padding; display, position, overflow, the box model; flex, flex-direction, justify-content, align-items; grid-template-columns, place-items, gap, center a div; length, aspect-ratio, specificity, inherit or not; background, border-radius, color, one honest hour; every property meaning traced to this box's cached MDN pages, and every number quoted read whole from a twenty-four line computed-style sweep this box's Chromium ran on the second of December, 2026.


Steve Hodgkiss 7 lessons

One property, one page, one honest capture. That is the shape of this book.

css, one property per page

Twenty-four lessons on the properties of CSS: box-sizing, width, margin, padding; display, position, overflow, the box model; flex, flex-direction, justify-content, align-items; grid-template-columns, place-items, gap, center a div; length, aspect-ratio, specificity, inherit or not; background, border-radius, color, one honest hour; every property meaning traced to this box's cached MDN pages, and every number quoted read whole from a twenty-four line computed-style sweep this box's Chromium ran on the second of December, 2026.


Set in Space Grotesk, Inter and JetBrains Mono (SIL Open Font License).

An honest book about its demo: Chromium 149.0.7827.55 (headless, Playwright, on the machine that built this book) ran a twenty-four line computed-style sweep on 2026-12-02 - box sizes, margins, padding, display values, positioning, overflow, flex and grid distribution, centering three ways, units, aspect ratio, specificity, inheritance, background, radius, color and cursor, each capture kept whole. The machine ran no website, started no server and opened no port; the sweeps set page fragments in memory and read the computed style back. Captures live in /root/.hermes/cache/web/slot193park/css_demo_full193.txt; no number was typed from memory. All property meaning traces to the cached MDN pages for that property (developer.mozilla.org, fetched 2026-12-02 with STATUS 200 and size headers recorded). The centering question and the beginner-frustration framing are mined from public beginner-thread titles, used as questions only, never as facts. No facts from vendor blogs, search-engine snippets or books about CSS. Independent, not affiliated with Mozilla, MDN or the W3C.

Your purchase is for personal use only. You do not have redistribution rights: please do not share, resell, or republish this book or its pages.

© 2026 Steve Hodgkiss. All rights reserved. Personal use only; no redistribution rights.

Edition 1.0 · stevehodgkiss.net

Contents

Contents


Part 1 · The box
box-sizing4
Part 2 · Flow and position
display5
Part 3 · Flex
flex6
Part 4 · Grid and centering
grid-template-columns7
Part 5 · Type and units
length8
Part 6 · The honest hour9
background10
one honest hour11

Per the MDN box-sizing page, The box-sizing CSS property sets how the total width and height of an element is calculated; border-box tells the browser to account for any border and padding in the values you specify for an element's width and height; The width and height properties include the content, but does not include the padding, border, or margin. Per a real capture on the build machine (2026-12-02), contentBox.w: 224; borderBox.w: 200. Per this book's plan, the switch opens the box part because every other number in this book depends on which math is on.

css companion · No. 01
the switch

box-sizing

declared size, honestly kept

one declared width, two honest answerscontentkept inside224painted, defaultbox-sizing: border-box200painted after the switchwidth:200px padding:10px border:2px, captured on one box each

MDN names the choice: the box-sizing CSS property sets how the total width and height of an element is calculated. The default counts content only: it does not include the padding, border, or margin.

Two identical divs got width:200px, padding:10px, border:2px on this box. The content-box side painted 224; with border-box the same box kept the declared 200.

Same declaration, honest edges: the number you write is the number you get, once you ask.

SPEND ONE HONEST HOUR

This week, add box-sizing:border-box to one boxed column and watch its neighbor stop shifting.

Per the MDN display page, The display CSS property sets whether an element is treated as a block or inline box and the layout used for its children; The element generates a block box, generating line breaks both before and after the element when in the normal flow; The element generates one or more inline boxes that do not generate line breaks before or after themselves; Turns off the display of an element so that it has no effect on layout. Per a real capture on the build machine (2026-12-02), inlineHeight: 17; noneWidth: 0; inlineBlockWidth: 100; inlineBlockHeight: 30. Per this book's plan, display opens part two: before a property can position anything, the box has to exist in a flow.

css companion · No. 02
the box type

display

block, inline, none, or both

four display values, three measured boxestext, then theinline spanstill text beside it17height: 100pxinline-block10030honors bothblock takes the full lineand breaks before the nextdisplay: none0the ghost measured 0: out of the layoutthe inline box asked for 100 and the line box returned 17

The display CSS property sets whether an element is treated as a block or inline box. A block means line breaks both before and after; an inline doesn't get them.

Captured: an inline span with height:100px measured 17 tall, the line box overruling the wish; a display:none box measured 0, no effect on layout; inline-block took both orders, 100 wide, 30 tall.

Height is a block-level promise: inline or none, it simply doesn't apply.

SPEND ONE HONEST HOUR

This week, give an inline span a height, inspect it, and count the pixels ignored.

Per the MDN flex page, The flex CSS shorthand property sets how a flex item will grow or shrink to fit the space available in its flex container; This property is a shorthand for the following CSS properties; then the shorthand expands to flex: <flex-grow> 1 0%; The item is sized according to its width and height properties. It is fully inflexible. Per a real capture on the build machine (2026-12-02), one: 200; two: 400; flexBasis: 400px; shrunkWidth: 300. Per this book's plan, the shorthand opens the part: three properties under one name is exactly the sentence a beginner needs once.

css companion · No. 03
the shorthand

flex

grow, shrink, basis in one line

flex is three properties wearing one nameflex: 1flex: 2200400grow, shrink, basis:one shorthand, not a width400px300flex:0 1 400pxasked 400, the container kept 300free space divided 1 to 2: 200 and 400 inside the 600 rail

sets how a flex item will grow or shrink to fit the space available - and flex is a shorthand: grow, shrink and basis wearing one name.

In the run's 600px rail, flex:1 and flex:2 divided the space as 200 and 400. A second item asked a basis of 400px inside 300px of room and shrank to 300.

flex:1 is three decisions in costume: it is not a width.

SPEND ONE HONEST HOUR

This week, set flex:1 on one child and flex:2 on the next, then read the widths back.

Per the MDN grid-template-columns page, The grid-template-columns CSS property defines the line names and track sizing functions of the grid columns; Represents a repeated fragment of the track list, allowing a large number of columns that exhibit a recurring pattern to be written in a more compact form. Per a real capture on the build machine (2026-12-02), fixedLefts: [8, 228, 448]; autoFillCellWidth: 126.39; wraps: false. Per this book's plan, fixed tracks first, then the responsive repeat: the second only makes sense once the first is measured.

css companion · No. 04
the track list

grid-template-columns

repeat(3,200px), measured

tracks from a list, or tracks from the room left20208228448the three captured left edgesgrid-template-columns: repeat(3,200px)auto-fill, minmax(120px,1fr)126.39per cell, as computedfixed: a 220 step (200 track plus the 20 gap); auto-fill: 126.39px cells

defines the line names and track sizing functions of the grid columns, one declaration: grid-template-columns:repeat(3,200px).

Captured item lefts: 8, 228, 448 - a 220 step, 200 of track plus the 20 gap. Swap in repeat(auto-fill,minmax(120px,1fr)) and the browser counts columns itself: every cell computed 126.39px in the 1264px content width.

Fixed tracks follow you, auto-fill follows the room: let minmax do the counting.

SPEND ONE HONEST HOUR

This week, replace one fixed track list with an auto-fill minmax and count the columns.

Per the MDN length page, The <length> CSS data type represents a distance value; The <length> data type consists of a <number> followed by one of the units listed below; Represents the calculated font-size of the element. If used on the font-size property itself, it represents the inherited font-size of the element; Represents the font-size of the root element; A common browser default is 16px. Per a real capture on the build machine (2026-12-02), fontPx: 40px; heightPx: 24; widthPx: 400; rootFont: 16px. Per this book's plan, units close the arithmetic before the last part turns to paint.

css companion · No. 05
the unit

length

px, em, rem, percent

a number is nothing until you ask what it is a number ofrootrememof 80016px2440px400height:1.5remfont-size:2emwidth:50%one parent, one root,one container to dividewidth: 50%400of the 800 container,not of the 1280 windowem follows the element, rem follows the root, percent the container

MDN opens plain: The <length> CSS data type represents a distance value. em reads the calculated font-size of the element; rem reads the font-size of the root element; a percent reads the container.

The capture ran one element: root 16px, font-size:2em on a 20px parent computed 40px, height:1.5rem computed 24, width:50% of 800 computed 400.

em follows the element, rem the root: choose whose size you mean.

SPEND ONE HONEST HOUR

This week, set font-size:2em and height:1.5rem on one element and read both values.

Part 6 of 6
background, border-radius, color, one honest hour
6

The honest hour

Per the MDN background page, The background CSS shorthand property sets all background style properties at once; This property resets the following CSS properties to their initial values. Per the MDN border-radius page, You can set a single radius to make circular corners, or two radii to make elliptical corners. Per the MDN color page, The color CSS property sets the foreground color value of an element's text. Per a real capture on the build machine (2026-12-02), aColor: rgb(67, 56, 202); bColor: rgba(0, 0, 0, 0); gradColor: rgb(238, 238, 238); circleTL: 50%; twoTL: 20px; purple: rgb(102, 51, 153); borderColorFromCurrentColor: rgb(102, 51, 153). Per this book's plan, paint closes the book the way it closes a page: the layers, then the corners, then the color that follows its source, then one honest hour at the reader's own computed tab.


In this part
  1. 01background
  2. 02one honest hour

Per the MDN background page, The background CSS shorthand property sets all background style properties at once, such as color, image, origin, size, and repeat method; The last layer is the bottom layer. The background color is always included in this layer; This property resets the following CSS properties to their initial values. Per a real capture on the build machine (2026-12-02), aColor: rgb(67, 56, 202); bColor: rgba(0, 0, 0, 0); gradImage: linear-gradient(90deg, rgb(67, 56, 202), rgb(224, 231, 255)); gradColor: rgb(238, 238, 238). Per this book's plan, the paint part opens with the shorthand that overwrites, because it is the line beginners type most and trust least.

css companion · No. 06
the stack

background

layers from the image down

background is a stack of layers, and the shorthand resets themtop: image layermiddle: position, size, repeatbottom: color layerrgb(67, 56, 202)rgba(0, 0, 0, 0)rgb(238, 238, 238)set the shorthand once andevery layer resets to initialtransparent is a captured rgba string, not the absence of a layer

One line, one stack: sets all background style properties at once, and the last layer is the bottom layer. The color always rides in it.

The capture read the stack as strings: the named color computed rgb(67, 56, 202), transparent computed rgba(0, 0, 0, 0), and under a gradient the color layer still reported rgb(238, 238, 238). The catch: one line resets the following CSS properties to their initial values.

One shorthand rewrites the stack: set the longhand you mean.

SPEND ONE HONEST HOUR

This week, set background on a styled div and count the layers it just erased.

Per this book's plan, the closer labels itself: one honest hour on your own page, devtools open, the computed tab, one property per click, one value changed, one recompute watched; this book ran twenty-four such readings on its own machine, and the hour asks for nothing more.

css companion · No. 07
the closer

one honest hour

devtools open, one property at a time

one property per click, one edit, one recomputecomputedwidthread one linemarginread one linepaddingread one linedisplayread one linepositionread one linecolorread one linethis book's plan:your page, devtools open,one property per click,change one value, watchno project, no pricesthe hour closes the way this book was written: one property at a time

Nothing new for once - a method. Per this book's plan: open devtools on your own page, sit on the computed tab, and work the way this book worked. One property per click, one value changed, one recompute watched.

If a number surprises you, go back to the page that names it. No project, no prices, no framework to install: just the panel, your box, and the habit this book is built from.

One property, one page, one honest capture: the hour is yours now.

SPEND ONE HONEST HOUR

This week, spend sixty honest minutes with devtools open: five properties, one changed value each.

Index

Index


background10
box-sizing4
display5
flex6
grid-template-columns7
length8
one honest hour11