1. Functions of CSS
Separate documents from formats; better control of web page layout; smaller web page size
CSS uses the rule control page. The rule is divided into two parts: Selection and description. You can select any HTML Tag. The description includes attributes and attribute values. The description is contained by the symbol.
2. Use CSS
2.1 product placement
Add the style sheet directly before the <body> page.
<Style type = "text/CSS">
<--
Style rules
-->
2.2 link type
Link the external CSS file to the document
<LINK rel = stylesheet url = "mycss.css" type = "text/CSS">
2.3 input type
Similar to the link type, but can be used with other methods
<Style type = "text/CSS">
<--
@ Import URL ("mycss.css ");
Other style rules
-->
2.4 inline
<P style = "font-family:">
<--
@ Import URL ("mycss.css ");
Other style rules
-->
2.4 inline
<P style = "font-family:">
<--
@ Import URL ("mycss.css ");
Other style rules
-->
2.4 inline
<P style = "font-family:">
3. CSS skills
Category: You can divide an option into different categories and control different categories. For example:
P. First {color: Green}
P. Second {color: Red}
P. Third {color: Gray}
<P class = first> This is the first class </P>
Or directly use the category name:. First {color: Green}. In this case, all the content colors of this category are green, not limited to the <p> label.
4.css Positioning Control
4.1 Absolute Positioning
P <position: absolute; left: 100px; top: 40px>
4.2 relative positioning
P <position: relative; left: 100px; top: 40px>
Positioning Relative to the position where the element should appear
4.3 visibility
P <visibility: hidden>
4.4 overlapping elements
P <z-index: 1>
When multiple elements share the same region, the largest element of the Z-index value is at the top, and the smallest element is at the bottom.
5.css font Control
5.1 font family: font name is the font-family value.
5.2 font size: the font-size value of the attribute.
Font size unit: Points (PT), EMS (EM), pixels (PX)
In(INCHES)Cm(Cm)Mm(Mm)
PC(Typewriter font size unit)Ex(X-height)
Font size Keyword:
XX-small
X-small
Small
Medium
Large
X-large
XX-large
5.3 Font Style: font-style
Parameter Value: italic oblique normal
5.4 words: font-weight
Parameter Value: bold normal
Or 100 200... 900