文本样式和文本的修饰

text-transform

1.默认文本样式

p{
  text-transform:none;
}

2.capitalize 文本中的每个单词以大写字母开头。

p{
  text-transform:capitalize;
}

3.uppercase 定义仅有大写字母。

p{
  text-transform:uppercase;
}

4.lowercase 定义无大写字母,仅有小写字母。

p{
  text-transform:lowercase;
}

text-decoration

1.默认文本样式

p{
  text-decoration:none;
}

2.underline 定义文本下的一条线。

p{
  text-decoration:underline
}

3.overline 定义文本上的一条线。

p{
  text-decoration:overline;
}

4.line-through 定义穿过文本下的一条线。

p{
  text-decoration:line-through;
}

5.去除超链接的下划线

a{
  text-decoration:none;
}

6.letter-spacing用来设置字符之间的间距

p{
  letter-spacing:10px  
}

7.work-spacing用来设置单词之间的间距

p{
  work-spacing:10px
}

对齐文本

text-align

可选值
1.left : 左对齐
2.right: 右对齐
3.justify: 两边对齐
4.center: 居中对齐

p{
  text-align:left;
}
在left处更换可选值right justify center

首航缩进

text-indent

p{
  text-indent:32px;
}
没有设置字号,浏览器默认16px;
如果我就想制作无论字号多大就缩进两个字的就要em单位
注:1em = 1font-size;
 p{
  text-indent:2em;
  font-size:30px;
}

你可能感兴趣的:(文本样式和文本的修饰)