liveBook · Manning

User-agent style

As explained in Tiny CSS Projects

Default styles are the initial presentation rules applied by a browser or operating system when author styles do not override them.

User-agent styles are the browser’s built-in CSS rules for HTML elements. They provide a readable starting appearance before author CSS is added, but different browsers can render the same element somewhat differently. section 1.4.1

User-agent styles commonly provide:

  • Larger, bolder headings that distinguish headings from ordinary text. section 1.4.1
  • Font sizes, border styles, and basic layouts for controls such as text inputs and progress bars. section 1.4.1
  • The lowest-priority stylesheet origin, so author styles and user styles can override it through the cascade. section 1.4 section 1.5

Progress bars and platform defaults

A bare <progress value="32" max="100">32%</progress> element displays using browser and operating-system defaults. Its appearance can vary across environments, and the colored progress indicator may offer few styling hooks. Customization therefore requires workarounds whose results and pitfalls depend on the platform. section 3.6

Resetting a fieldset

A fieldset can remain meaningful to assistive technology while visually blending into a design. Reset its browser defaults with border: 0, padding: 0, and margin: 0. section 10.2

Figure 3.14 Progress bar starting point in Chrome

Compare the unstyled progress bar with later author styling to see which appearance comes from user-agent rules. section 3.6

How Tiny CSS Projects covers it

How deep it goes
Defines the stylesheet origin, priority, common properties, and platform variation, but stops short of detailing browser implementations.
Examples
Uses headings, form controls, progress bars, and fieldsets to show defaults, variation, and practical resets.
What it assumes
Assumes basic HTML and CSS declarations while introducing stylesheet origins, cascade priority, and browser defaults.
What you can do after
Apply CSS resets and overrides while anticipating browser differences in native controls.
How it connects
Connects user-agent styles with the CSS cascade, specificity, author stylesheets, user stylesheets, and accessibility.

Also explained in

Compare how 3 books explain user-agent style →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Tiny CSS Projects. The section links point to the parts of the book it draws on.