CSS basics??Formatting text of element content using CSS_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:56:32
Original
1019 people have browsed it

The text properties of CSS are used to control the paragraph format of text, such as setting the first line indentation, paragraph alignment, word spacing, line spacing, etc.

1. Set first line indent of text : text-indent

Optional attribute values ​​include: length/percentage

2. Set Text alignment : text-align

Optional attributes include: left / right / center, respectively indicating left alignment, right alignment, and center alignment

3. Settings Text decoration method: text-decoration

Optional attributes include: none/underline/overline/line-through/blink

4. Set text shadow effect : text-shadow
Optional attribute values ​​include: none / color
5. Set line height : line-height
Attribute value can be number, length, percentage or normal
6. Set character spacing: letter-spacing
Optional attribute values ​​include: none / auto / custom length
7. Set word spacing : word-spacing
Optional attribute values ​​include: none / custom length
8. Set text case attribute : text-transform
Optional attributes include: capitalize turns the first letter of each word into uppercase
uppercase turns all letters in the element into uppercase
lowercase turns all letters in the element into lowercase
9 , Set blank display format : white-space
The way to enter spaces: one is " ", the other is the

 mark. The white-space attribute in CSS is similar to pre
. Optional attribute values ​​include: normal / pre / nowrap
10. Set the font color and background of the element content
(1) Setting Element's foreground color : color
value: can be a hexadecimal value, rgb() function or a color name recognized by CSS (such as white)
(2) Set background Color : background-color, the value is the same as the foreground color
(3) Set background image : background-image
The value is: the URL address of the image
(4 )Set layout of background image: background-repeat
Value: repeat / no-repeat / repeat-x / repeat-y
(5) Set whether the background image is an object content scrolling or Fixed: background-attachme
Value: sroll / fixed
(6) Set the position where the background image is displayed : background-position
Value: percentage, custom length (such as 100px,100px) / top / center / bottom / left / right
11. Set list format: list-style-type
attribute value: disc default value, solid black dot
circle hollow circle
square square black block
decimal decimal number
lower-roman lowercase Roman numeral
upper-roman uppercase Roman numeral
lower-alpha lowercase letter
upper-alpha uppercase Letters
none None
You can also use list-style-image to replace the symbols in front of the list with graphics. If the list-style-type and list-style-image attributes are specified at the same time, it will only be displayed when the browser cannot display it. List-style-type only takes effect when pictures are used as bullet points.
12. Style inheritance : used to save the CSS style rules specified for each level element in the document. For example, if a font color is set for , this color will be All elements within the page inherit this, unless other elements have their own specific styles.
Properties that cannot be inherited: margin, padding, border, background

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template