css:( color、line-height、 text-indent、text-align、text-decoration)

1. color: text color

The color attribute is used to define the color of the text, and its value can be obtained in the following three ways:

1、预定义的颜色值,如red,green,blue等。
2、十六进制,如#FF0000,#FF6600,#29D794等。实际工作中,十六进制是最常用的定义颜色的方式。
3、RGB代码,如红色可以表示为rgb(255,0,0)或rgb(100%,0%,0%)。

It should be noted that if the percentage color value of the RGB code is used, the percentage sign cannot be omitted when the value is 0, and it must be written as 0%.

Two, line-height: line spacing

The line-height attribute is used to set the line spacing, which is the distance between lines, that is, the vertical spacing of characters, which is generally called line height.

There are three commonly used attribute value units for line-height, namelyPixel pxRelative value emwithpercentage%, The pixel px is the most used in actual work

Generally, the line spacing should be about 7.8 pixels larger than the font size.

Three, text-indent: indent the first line

The text-indent attribute is used to set the indentation of the first line of text, and its attribute value can beNumerical values ​​in different unitsMultiple of em character width,orRelative to the percentage of the browser window width%, Negative values ​​are allowed, and em is recommended as the setting unit.

1em is the width of a word. If it is a paragraph of Chinese characters, 1em is the width of a Chinese character.

Four, text-align: horizontal alignment

The text-align attribute is used to set the horizontal alignment of the text content, which is equivalent to the align attribute in html. The available attribute values ​​are as follows:

  • left: Left alignment (default value)
  • right: align right
  • center: center aligned

Five, text-decoration

text-decoration, the decoration of the text, usually we use to modify the decorative effect of the link

Insert picture description here

Guess you like

Origin blog.csdn.net/qq_41504815/article/details/114134725