字体
p {font-family: "微软雅黑";
}
h2 {font-family: "Microsoft YaHei",Arial;
}
字体大小
p {font-size: 20px;
}
字体粗细
p {font-weight: normal | bold | bolder | lighter | number
}
normal:正常字体,默认值
blod:粗体
bolder:特粗体
lighter:细体
number:数字 (后面不要加单位) 开发时常用
示例,标题在使用的时候经常去掉加粗
h2 {font-weight: 400;
}
文字样式
p {font-style: normal | italic;
}
字体复合属性
div {font: italic(font-style) 700(font-weight) 16px(font-size/line-hight) 'Microsoft yahei'(fonnt-family);
}
font-size
和font-family
属性,否则 font(整个css属性) 都不起作用文本颜色
div {color: red;
}
对齐文本
div {text-align: center | left | right;
}
装饰文本
p {text-decoration: none | underline | overline | line-through;
}
实例:去除链接的下划线
a {text-decoration: none;
}
文本缩进
p {text-indent: 20px | 2em;/* 首行缩进20px *//* 2em是当前2个文字大小 */
}
行间距
p {line-height: 26px;
}
上一篇:【SQL】获取今天昨天本周上周本月上月本年去年的起止日期
下一篇:fanotify