css文本属性

1.字体样式

让倾斜变得不倾斜/*英文逗号隔开,多个单词使用引号*/
p {
font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
}

/*字体大小*/
font-size: 30px;

/*字体粗细*/ /*【700 bold 加粗】 ; 【400 normal常规】*/
font-weight: 700;

/*斜体*/
font-style: italic;
/*让倾斜变得不倾斜*/
font-style: normal;

/*符合性写法*/
font: italic 700 16px "Microsoft yahei";
/*font: 不倾斜 - 字体的粗细 - 字体大小行高 - 字体类型*/


2.文本对齐

/*左边*/
text-align: left;

/*居中*/
text-align: center;

/*右边*/
text-align: right;


3.装饰文本

/*取消下划线*/
text-decoration: none

/*下划线*/
text-decoration: underline;

/*上划线*/
text-decoration: overline;

/*删除线*/
text-decoration: line-through;


4.文本缩进

/*文字大小的2倍 或者是 2em */
text-indent: 20px;


5.行高继承

line-height: 36px;

/*父亲元素 文字的1.5倍 行高的1.5倍*/
font:12px/1.5

营销型网站