CSS syntax is designed to make the content of the Web page and visual separation, on the one hand, make the page maintenance easier, not because the content or visual effects of changes affect the other side, such a page design, but also for the search engine more friendly, easier to search the content of the page.
Css,cascading Style Sheets
Threaded style sheets, Web page appearance control syntax
The World Wide Web was originally made up of the concept of a file, and it was hoped that through web pages and hyperlinks, it would be easier to connect files with knowledge. It is not difficult to see the nature of the WWW from the extensive use of the label of the concept of the file in HTML syntax (for example, the
of a representative paragraph representing a title).
However, www is more attractive than other early internet media, because it can embed and present pictures directly on the page, this change makes the WWW develop rapidly, and also makes the page visual decoration greatly popular. But the Web page inherent file character, let the image typesetting design difficult to display hands and feet, so like the use of nested forms and images of the page into the popular, in order to achieve accurate element positioning and more exquisite visual effects. This Pandora box opened, causing a lot of uncontrolled chaos, so that the page original code difficult to read and maintenance.
In order to improve the visual performance of the Web page, the world's first edition of the CSS in 1996 to provide a solution. However, because CSS relies on browser support, so long since the implementation of CSS has been poor, to IE 6, Firefox and other mainstream browsers to support CSS, only gradually improved.
CSS syntax is designed to make the content of the Web page and visual separation, on the one hand, make the page maintenance easier, not because the content or visual effects of changes affect the other side, such a page design, but also for the search engine more friendly, easier to search the content of the page. Second, CSS can also increase the page in different media rendering effect. The same page, can be based on different uses, such as screen display or printing, and automatically switch to different CSS syntax, so that rendering optimization. Also because of the more and more media read the page (such as mobile phone, PDA), CSS can be flexible to adjust the presentation, all more highlight the advantages of CSS in the Web page.
Selector
Selector
To apply a style effect to HTML elements through CSS, you first have to point to a specific element, such as a title, paragraph, or hyperlink, and the specified method is called a selector.
The most basic selector, is the name of the specified HTML label element, along with the ID picker, category Picker, Virtual class, sub system, and so on, but these CSS selection methods, each browser has different support, such as IE 6 does not support a child or a side of the selector.
Divist
The designer who abused the DIV tag
In fact, the use of CSS string and inheritance features, can create a precise, rich visual effects. But not just CSS, the abuse of grammar can improve.
In the past, nested table typesetting has been prevalent, resulting in Web source code difficult to read and maintain. However, if CSS designers do not make good use of string and inheritance, and a large number of Div block syntax for page layout, will make the page raw code filled with div tag, which is often the same as using nested tables, difficult to read, this designer is called "divist". CSS is not a panacea, you need to rely on the correct use of designers to achieve results.
Quirk Mode
Quirk pattern
When the browser is revised, usually reinforces the support for standard syntax for Web pages, but it also means that pages written in the past browser features have problems with rendering, and in order to maintain forward compatibility, browsers typically design standard patterns and "quirks" patterns to ensure that some old sites use looser, The grammar interpretation method with high fault-tolerant rate is presented.
Depending on the DOCTYPE and DTD declared by the Web page, the browser determines that page rendering will follow standard or quirk patterns.
Cascade rule
String Connection Rules
CSS has threaded rules and degrees of clarity to handle style conflicts. Threaded rules are sorted by importance and decide which style to use.
In threaded rules, the most important is the user style labeled with "!import", followed by the author style sheet, which is also marked with "!import".
The author style sheet is more important than the user in the absence of a label "!import". By the importance of the rules, the browser can decide which style to render, and if the importance is consistent, the latter rule will overwrite the older rules.