First chapter CSS and documentation
Css:cascading style sheet Cascading style sheet
W3c:world Wide Web Consortiam www alliance
Elements (Element) are the basis of a document, divided into
- Replacement elements (replaced element): refers to parts of the content that are used to replace elements not directly represented by the contents of the document
- Non-replacement elements (nonreplaced Element): The contents of which are displayed by the user agent (usually a browser) in the box generated by the element itself
- Block-level element (Block-level): Generates an element box that generates a "delimiter" before and after the element box. Block-level elements populate the content area of their parent element
- inline Element (Inline-level): Generates an element box within a line of text that does not break this line of text. Do not generate a "delimiter" before or after itself
In HTML and XHTML, block-level elements cannot inherit self-contained elements, and CSS has no restrictions on how roles are nested
- External style sheet (external style sheet)
<link rel= "stylesheet" type= "Text/css" href= "" media= "All"/>
- Candidate style sheet (alternate style sheet): Sets the properties of rel to alternate stylesheet, which is always displayed only if the user chooses the style sheet. Title is also a property of link, the browser will use the link element's Title property value for the candidate style sheet named, the same title is worth the candidate stylesheets will be grouped together by the browser. The IE itself does not support candidate stylesheets and can be supported by JavaScript
If you specify a title for a rel-stylesheet link, you specify the style sheet to be preferred style sheet (the preferred style sheet), and if you specify a set of style sheets as the preferred style sheet, only one of them is used.
<style type= "Text/css" > </style> document style sheets, nested style sheets
- @import URL () can only appear in the style container, and CSS requires @import directives to appear before other rules in the style sheet, otherwise it will be ignored (ie will not ignore any @import directives)
Backward accessibility: Include the declaration in the HTML comment tag, and older browsers that do not support style will ignore the style, and the subsequent declaration is annotated.
CSS Comments:/* */Do not support nesting
- inline style (inline style): not recommended
Chapter II Selector
Each style sheet is made up of a series of rules
Rule: Selector (selector) Declaration block (Declaration block)
A declaration block consists of one or more declarations, each of which is an attribute-value pair (Property-value)
Element selector: HTML element
In almost all cases, the value is either a keyword or a list of the attributes ' desirable keywords, separated by a space, and if an incorrect attribute or value is used in the declaration, the entire declaration will be ignored
Exception: H2 {font:large/150% Sans-serif}; Slash to separate two keywords that set the font size and row height
Selector grouping: Separating different selectors with commas
Wildcard selector (Universal selector): Displayed as a *, can match any element
Claim grouping: Add a semicolon at the end of each declaration. Grouping with combination selectors and declarations is usually used
Class Seector: To apply a style without regard to the element involved. Class{property:value}
"Reading Notes" CSS authoritative guide