css 字体、文本、列表样式

1.字体样式

font-family:设置字体类型  font-family:"隶书"||"wps里面有的"||"常用微软雅黑Microsoft YaHei";

font-size :设置字体大小  font-size:12px;

font-style :设置字体风格  font-style:

  • normal - 文本正常显示
  • italic - 文本斜体显示
  • oblique - 文本倾斜显示

font-weight:设置字体粗细 font-weight:

  关键字 100 ~ 900 为字体指定了 9 级加粗度。如果一个字体内置了这些加粗级别,那么这些数字就直接  映射到预定义的级别,100 对应最细的字体变形,900 对应最粗的字体变形。数字 400 等价于 normal,  而 700 等价于 bold。

符合属性(必须按照顺序写)

举例: font:italic bold 36px "宋体";

2.文本样式

color:设置文本颜色  color:#00c(表示#0000cc)||red||#0acacc;

text-align: 设置元素水平对齐方式  text-align:left;

值 left、right 和 center 会导致元素中的文本分别左对齐、右对齐和居中。

text-indent:设置首行文本的缩进  text-indent:20px(缩进20个像素)||2em(缩进2个字符);

line-height:设置文本的行高  line-height:25px;

text-decoration:设置文本的装饰 

text-decoration 有 5 个值:

  • none 什么都没有
  • underline  下划线
  • overline 上划线
  • line-through  删除线
  • blink  闪烁

 3.列表样式

none:无标记符号  list-style-type:none;

disc:实心圆,默认类型  list-style-type:disc;

circle:空心圆

square:实心正方形

decimal:数字

猜你喜欢

转载自www.cnblogs.com/19322li/p/10815201.html