liveBook · Manning

Style property

As explained in Web Design Playground, Second Edition

A CSS property is a named presentation characteristic whose value can be specified by a CSS declaration and may be inherited by descendants.

A CSS property is a named setting that controls one part of a page’s appearance. Think of it as a tiny instruction for the browser: color changes text color, font-size changes text size, and margin changes the space around an element. Give a property a value, and together they form a declaration. section 2.3

Figure 2.4 The syntax to use for defining CSS properties

A style rule has a selector to choose elements, curly braces to hold the instructions, and one or more property-value declarations inside. section 2.3

Set a heading size

To make every h1 heading 36 pixels tall, choose h1, then add font-size: 36px; inside the braces. The colon separates the property from its value; the semicolon ends the declaration. Add more declarations to style the same elements. section 2.3

CSS properties can handle visible jobs such as:

  • Formatting text with properties for color, font size, typeface, alignment, small caps, or italics. section 2.3 section 4.7
  • Sizing, spacing, and separating elements with width, height, padding, borders, and margins. section 9.0
  • Applying global styling while building page sections such as headers, introductions, links, and footers. section 5.7

PLAY: Type a property definition in a CSS editor, check the browser result, then change the value and look again. CSS is much less mysterious when you can see each small instruction do its thing. section 1.5

How Web Design Playground, Second Edition covers it

How deep it goes
Defines property-value declarations and style-rule syntax, then demonstrates font-size without surveying every property.
Examples
Demonstrates font-size on h1 and font-style: italic on span elements.
What it assumes
Teaches properties from zero while using HTML elements such as h1 and span in examples.
What you can do after
Apply it via the Web Design Playground by editing CSS properties and checking rendered results.
How it connects
Connects properties with selectors, declarations, style rules, HTML elements, units, and inline styles.

Also explained in

Compare how 4 books explain style property →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Web Design Playground, Second Edition. The section links point to the parts of the book it draws on.