Front-end web page learning 3 (css text attributes and text attributes)

Front-end web page learning 3 (css text attributes and text attributes)

Css font attributes

Css font attributes:

  1. font-family: font;
  2. font-size: font size;
  3. font-weight: font weight;
  4. font-style: font;
    normal writing: (notes are in the code remarks)
.font {
    
    
            font-family: '宋体',Arial, Helvetica, sans-serif;
            /* 单引号双引号都可以 */
            /* 从左往右显示 */
            /* 尽量使用常用字体 */
            /* body字体设置 */
            font-size: 20px;
            /* 字体大小 */
            /* px像素 默认16 */
            /* 尽量自己设置防止不同浏览器显示不同 */
            font-weight: 600;
            /* 字体粗细 */
            /* 不加单位400normal */
            font-style: italic;
            /* 斜体 */
        }

Abbreviation:
fixed order font-font size-font weight-font. At
least two attributes of font size and font are required

.font-new1 {
    
    
            font: italic 700 16px '宋体'
        }
.font-new2 {
    
    
            font: 36px '宋体'
        }

Css text attributes

Color
:

  1. red
  2. #cc0000
  3. reg(255,0,1)
  4. reg(100%,10%,10%)

Align
textalign horizontally :

  1. left (default)
  2. right
  3. center;

Text
-decoration:

  1. none (default) none
  2. underline
  3. overline
  4. line-through

Indent the first line
text-indent:

  1. 100px (right indentation) px pixels
  2. -20px (left indentation)
  3. 3em (one word) em

Line spacing
line-height: 50px;

p {
color: red;
text-align: left;
text-decoration: overline;
text-indent: 0em;
line-height: 0em;
}


Guess you like

Origin blog.csdn.net/qq_40551957/article/details/113470137