Skip to content

Commit

Permalink
Default Styles lesson: Add missing word (#27792)
Browse files Browse the repository at this point in the history
* Fix missing word

* Remove unnecessary apostrophe

Co-authored-by: MaoShizhong <122839503+MaoShizhong@users.noreply.github.com>

---------

Co-authored-by: MaoShizhong <122839503+MaoShizhong@users.noreply.github.com>
  • Loading branch information
racodess and MaoShizhong committed Apr 14, 2024
1 parent b2a5357 commit 99b80df
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ This section contains a general overview of topics that you will learn in this l

### What are default styles and where do they come from?

As you have worked on projects, you likely observed default styles applied to certain elements, such as larger and bolder headings on `h1` elements, and blue, underlined links on `a' elements. There is also a good chance you struggled with things like default margins and padding. These styles are part of the user-agent stylesheets, ensuring basic styling for webpages without CSS. Each browser has it's own set of user-agent stylesheets so the default styles do slightly between browsers.
As you have worked on projects, you likely observed default styles applied to certain elements, such as larger and bolder headings on `h1` elements, and blue, underlined links on `a' elements. There is also a good chance you struggled with things like default margins and padding. These styles are part of the user-agent stylesheets, ensuring basic styling for webpages without CSS. Each browser has its own set of user-agent stylesheets so the default styles do vary slightly between browsers.

### What if I don't like the defaults?

With very few exceptions you can simply write your own CSS rules. The rules you write in your stylesheet have higher precedence than the user-agents rules, and therefore overwrite the defaults. However, there is another option.
With very few exceptions you can simply write your own CSS rules. The rules you write in your stylesheet have higher precedence than the user-agents rules, and therefore overwrite the defaults. However, there is another option.

To address inconsistencies across browsers and establish a consistent starting point for styling, some developers started using CSS resets. These resets are stylesheets containing CSS rules aimed at altering or removing the defaults set by user-agent stylesheets. Using them can help achieve consistency, and can provide a clean slate for developers to apply their styles without interference.

Expand Down

0 comments on commit 99b80df

Please sign in to comment.