In the previous article, I pulled the HTML stuff and now I want to read CSS,
1. completely separated HTML and CSS
Avoid using the style attribute on the label at any time; move the content in the <style> label to an external CSS file;
2. Select characters, attributes, and values.
Selector {property: Value}
The best unit of the font-size attribute value is em or %, because it has scalability.
3. Font-family font family
Multiple fonts must be separated by commas (,). the browser will search for the listed fonts one by one until the fonts installed on the computer are found. If a font name contains more than one word, double quotation marks are required, as shown in figurefont-family: "Times New Roman"
.
4, font-size
The font-size attribute can be used for paragraph font control. For titles, you can use titles such as H1 ~ H6
5. Font-weight bold
The common values of the font-weight attribute are bold and normal. Other value browsers are not compatible.
6. Text-decoration font Decoration
Whether to underline the decorative font. Overline-dashes; underline-underline; line-through-dashes; none-none.
7. Text-transform font conversion
Capitalize-upper-case; uppercase-upper-case; lowercase-lower-case; none -...
8. Text spacing
Letter spacing letter-spacing; Word spacing word-spacing; line-height paragraph line height;
Horizontally aligned text-align; text indent text-indent
9. Margin margin, padding, and box model
That is, the border (margin) and padding (padding)
Margin box (boundary box) Border box (border box) padding box (fill white box) element box (element box)
10, border
Border; border-style; border-width; border-color ;...
11. Font
Font:Font-style,Font-variant,Font-weight,Font-size/line-height,Font-family.
Pay attention to the order of attribute values,
Example: P {Font: italic small-caps bold 14px/15px Arial, Helvetica, sans-serif ;}
If some attribute values are left blank, the remaining attribute values must be in the order,
Example: P {Font: bold 14px Arial, sans-serif ;}