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.
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
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.
box-sizing
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.
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.
display
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.
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.
flex
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.
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.
grid-template-columns
defines the line names and track sizing functions of the grid columns, one declaration: grid-template-columns:
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.
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.
length
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.
This week, set font-size:2em and height:1.5rem on one element and read both values.
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.
- 01background
- 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.
background
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.
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.
one honest hour
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.
This week, spend sixty honest minutes with devtools open: five properties, one changed value each.