CSS design: Chapter 2
- XHTMLAnd HTMLImportant differences
1. Mark the name in XHTML in lower case
2. In XHTML, the attribute name must be in lowercase.
3. the tags in XHTML must be strictly nested.
4. Mark in XHTML as closed
5. In XHTML, even the tags of empty elements must be closed.
6. In XHTML, attribute values are enclosed in double quotation marks.
7. In XHTML, the attribute value must be in the complete form.
8. In XHTML, we should distinguish between "content tag" and "structure tag"
- In HTMLIntroduce CSSMethod
1.Inline
<H1 style = "color: white; background-color: blue">
This is a line of Text.
2.Embedded
<Style>
H1 {
Color: white;
Background-color: blue
}
</Style>
3.Import Type
<Style>
@ Import "mystyle.css ";
</Style>
4.Link Type
<Link href = "mystyle.css" rel = "stylesheet"/>
1.Tag selector:HTML Tag
2.CATEGORY selector:. Category name
3. IDSelector:# ID
1."Intersection"Selector
Div. special {......}
Div # special {......}
2."Union set"Selector
Div, h1.first, p. special {......}
3.Descendant Selector
Div h1.first span. firstLetter {......}
4.Sub-selector (IE6Not Supported)
P> span {......}
CSS inheritance means that the child tag inherits all style styles of the parent tag and can be modified based on the style of the parent tag to generate a new style, the style of the Child tag does not affect the parent tag.
Priority rules:Intra-row style> ID style> category style> markup style