一:缩写格式:font:style weight size family;
例如:italic bold 10px "楷体";
注意点:1.在这种缩写格式中有的属性值可以省略(style、weight可以省略)。
2.在这种缩写格式中style和weight的位置可以交换。
3.在这种缩写格式中有的属性不可以省略(size、family不能省略)。
例如:italic bold 10px "楷体";
注意点:1.在这种缩写格式中有的属性值可以省略(style、weight可以省略)。
2.在这种缩写格式中style和weight的位置可以交换。
3.在这种缩写格式中有的属性不可以省略(size、family不能省略)。
4.在这种缩写格式中size和family的位置不能随便乱放,size一定要写在family的前面,而且size和family必须写在所有属性的最后。
二:文本属性
1.文本装饰的属性
格式:text-decoration: underline;
取值:
underline 下划线
line-through 删除线
overline 上划线
none 什么都没有,最常见的用途是去掉超链接的下划线
快捷键:
td text-decoration: none;
tdu text-decoration: underline;
tdl text-decoration: line-through;
tdo text-decoration: overline;
2.文本水平对齐的属性
格式: text-align: right;
取值:
left 左
right 右
center 中
快捷键
ta text-align: left;
tar text-align: right;
tac text-align: center;
3.文本缩进的属性
格式:text-indent: 2em;
取值:
2em 其中em是单位,一个em代表缩进一个文字的宽度,2个em代表缩进两个文字的宽度
快捷键:
ti text-indent:;
ti2e text-indent: 2em;