Sources of CSS in three styles: creative staff, readers and user agent

See original: https://www.cnblogs.com/JJJJJKKKKK/articles/4542545.html

CSS styles in a total of three sources: creators, audience and user agents, different sources will affect the cascade fashion style, a lot of first learning CSS friends, these three sources there may be some confusion, the following I write about my own understanding, if so please correct me wrong places.

First, the creators (author's + style) style should be the most familiar to us, if you are a front-end developer, then those styles you wrote is called the staff style creation.

Then the user agent style (agent's + style), the user agent is what we usually refer to the browser (IE, Firefox, etc.), these browsers provide some default styles, such as IE browser in a purely html page code consisting of, we will find a hyperlink will appear with a blue foreground color, which is actually on the user agent style, borrow some plug-ins we can easily see these default styles (such as in Firefox Web + developer)

Finally, and most likely to be ignored by our readers styles (reader's + style). Readers nature is called browse pages, there are times when these users are not satisfied with where people might color pages, or font size, which is when they add style to the site readers through the interface provided by the browser.

Introduced over the source of us how to sort by weight and origin, in accordance with the right to "CSS The Definitive Guide" (third edition P79) summarized reordering:

Style 1. + creators +> + + style readers personnel> + User Agent default style

2. + marked as important statement (! Important) readers Style +> + All Styles

Some friends may not quite understand the meaning of the beginning of Article II, in fact, this is a good choice mechanism provided by CSS, that is, under normal circumstances, creators style will have the largest weight, which is also as a development most people want to see, but the user has the final right to choose, you can! important to cover any style you want covered.

See original: https://www.cnblogs.com/JJJJJKKKKK/articles/4542545.html

发布了48 篇原创文章 · 获赞 52 · 访问量 5万+

Guess you like

Origin blog.csdn.net/letterTiger/article/details/97821218