Three style sources in the reprint CSS: creators, readers, and user agents

Source: Internet
Author: User

CSS in a total of three types of sources: creators, readers and user agents, different sources will affect the style of cascading, many of the first time to learn CSS friends, the three kinds of sources may have some confusion, the following I write your understanding, if there is wrong place also please correct me.

First of all, the creator (author's style) style should be familiar to us, and if you're a front-end developer, those styles you write are called authoring styles.

Then is the user-agent style (agent's style), the user agent is what we usually say the browser (IE, Firefox, etc.), these browsers will provide some default style, such as in IE, a purely HTML-coded Web page, We will find that the hyperlink will have a blue foreground color, in fact, the user-agent style, borrowing some plug-ins we can easily view these default styles (such as the web Developer in Firefox)

Finally, the reader's style is also the easiest to overlook. The so-called readers are naturally browsing the Web users, sometimes these users may not be satisfied with the color of the page, or font size, this time they are through the interface provided by the browser for the site to add reader style.

After the introduction of the source, let's take a look at how to sort by weight and source, based on the weights summarized in the CSS authoritative Guide (third edition P79):

  1. Author's style > Reader's style > Default style for user agent

  2. Reader style > All styles marked as important declaration (!important)

Some friends may not understand at first the meaning of the second, in fact, it is a good choice of CSS provides a mechanism, that is, usually, the author style will have the greatest weight, which is what developers want to see, but the user has the ultimate choice, you can pass! Important overrides any style that you want to overwrite.

Original address: http://www.rays2010.com/blog/?p=2894

Three style sources in the reprint CSS: creators, readers, and user agents

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.