Browser defaults and developer tools
Definition and purpose
Browsers provide default styling through user-agent stylesheets. Developer tools let you inspect the actual element, matching rules and resolved style values. The inspector helps distinguish rules written by the page author from the browser defaults.
Default heading versus author color
<!doctype html><html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>CSS practice</title> <style>p { color: navy; }</style> </head> <body> <h1 id="a">Overview</h1> <p id="b">Summary</p> </body></html>Inspect the heading and paragraph separately; only the paragraph has this author color.
Syntax and mental model
Open Inspect on a heading, find the Styles pane and locate the declarations affecting color. Crossed-out declarations may be overridden or invalid; look for the displayed reason. The Computed pane reports resolved values, often in a normalized form such as rgb(0, 0, 128). Edit a declaration temporarily and observe the change; then make the real edit in the source file. Browser defaults can vary.
Competing declarations
<!doctype html><html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>CSS practice</title> <style>p { color: green; } p { color: navy; }</style> </head> <body> <p id="a">Status</p> </body></html>With equal selectors and normal declarations here, the later color wins. Inspect the crossed-out earlier value.
Common mistakes
An inspector edit is usually temporary; refreshing may discard it. A declaration appearing in Styles is not proof that it wins. The next chapter teaches selection in depth and the cascade chapter explains precedence.
Practice and next steps
After trying the examples, complete the linked coding exercise and review questions. Predict the result before running your code. Prerequisite: Comments and syntax recovery. Next lesson: First styled profile.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Browser defaults and developer tools — knowledge check
Five questions on browser defaults and developer tools.
Where do initial browser heading styles usually come from?
Which DevTools pane helps see the resolved color?
Why may a declaration be crossed out?
Will a temporary inspector edit always survive reload?
For p { color: green; } p { color: navy; }, which color wins here?