CSS basics 4-use CSS to format the text of Element Content
The text attribute of CSS is used to control the paragraph format of the text, such as setting the indent of the first line, paragraph alignment, spacing, line spacing, and so on.
1. SetIndent the first line of text: Text-indent
Optional attribute values include: length/Percentage
2. SettingsText alignment: Text-align
Optional attributes include left, right, and center, indicating the left-aligned, right-aligned, and center-aligned respectively.
3. SetText Modifier: Text-decoration
Optional attributes include none, underline, overline, line-through, and blink)
4. SettingsText shadow effect: Text-shadow
Optional attribute values include none/color.
5. SettingsRow Height: Line-height
The attribute value can be a number, length, percentage, or normal value.
6. SettingsWord spacing: Letter-spacing
Optional attribute values include none/auto/custom length.
7. SettingsWord spacing: Word-spacing
Optional attribute values include none and custom length.
8. SettingsText case sensitivity: Text-transform
Optional attributes include capitalize, which converts the first letter of each word into uppercase letters.
Uppercase converts all the letters in the element into uppercase letters.
Lowercase converts all letters in the element to lowercase letters.
9. SettingsBlank display: White-space
Enter space: "& nbsp;", and
Mark. The white-space attribute in CSS is similar to that in pre
Optional attribute values include normal, pre, and nowrap.
10. SettingsFont color and background of Element Content
(1) set the element'sForeground: Color
Value: it can be a hexadecimal value, an rgb () function, or a color name recognized by CSS (such as white)
(2) settingsBackground Color: Background-color, with the same value as the foreground color
(3) settingsBackground Image: Background-image
Value: the URL of the image.
(4) settingsBackground Image placement: Background-repeat
Value: repeat/no-repeat/repeat-x/repeat-y
(5) It is fixed to set the background image to scroll like the old object: background-attachme
Value: sroll/fixed
(6) settingsPosition of the background image: Background-position
Value: percentage, custom length (such as 100px, 100px)/top/center/bottom/left/right
11. SettingsList format: List-style-type
Property Value: disc default value, solid black spot
Circle
Square Black Block
Decimal
Lower-roman lowercase roman numerals
Upper-roman upper-case roman numerals
Lower-alpha lowercase letters
Upper-alpha uppercase letters
None
You can also use list-style-image to replace the symbols in front of the list with images. If both the list-style-type and list-style-image attributes are specified, the list-style-type takes effect only when the browser cannot display an image as a project symbol.
12. StyleInheritance: Used to save the CSS style rules specified for each level of elements in the document book. For exampleIf you set a font color, the color will be inherited by all elements in the webpage, unless other elements have their own styles.
Attributes that cannot be inherited: Margin, padding, border, background