CSS style, css
Css style sheet:
1. Classification of style sheets:
<1>. Use inline style: Example template: (set style for Section p)
<P style = "color: Red; font-size: 25pt;">
Paragraph text (p)
</P>
Features: (only valid for the labeled P tag)
<2>. Internal style: add the style to the
<Style type = "text/css">
H1 {color: Bule; font-size: 20pt ;}
</Style>
Feature: it is valid for all h1 labels on a page, but only for one page
Cannot be valid for another html
<3>. External style sheet: (this effectively improves code reusability for all imported pages)
Import required: <link type = "text/css" rel = "stylesheet"
Href = "external style table path"/>
2. style sheet priority:
The Inline style has the highest priority.
Internal style, external style to see who is at the front and who is at the front has a higher priority
3. Selector
3.1 selector category:
3.1.1 tag Selector
<Style type = "text/css">
Label, span, and so on {
Define Style
}
P span {
Define a style (span label under the p label
Apply the style defined by the p label before using
Span tag
A B c {
(C under B under)
}
</Style>
3.1.2 class selector
. {
Define Style
}
(Usage:
<Div class = "a">
Content
</Div>
)
3.1.3 ID Selector
# Aa {
Define Style
}
(Usage:
<Div id = "a">
Content
</Div>
)
3.1.4 pseudo-class selector
A: link {
}
A: hover {
}
A: visited {
}
Complex selector:
Usage 1:
Selector 1 selector 2 {
}
# {
(# A selector under a selector)
}
Usage 2:
Selector 1, selector 2 {
}
# A, {
Parallel
}
4. Common style attributes
4.1 table layout is generally not used (with minor changes) <table> </table>
Common layer layout <div> border = "" </div>
Box Model
Firefox browser debugging with view-firebug
Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.