* {
/*font-family: "微软雅黑";*/
font-family: "microsoft yahei", Arial;
/*font-family: Arial;*/
}
p {
font-size: 16px; /*千万别忘了带px 单位*/
line-height: 28px; /* 行高 行与行之间的距离*/
text-indent: 2em; /*段落首行缩进2个字 em 也是一个单位 1em 就是一个字的距离 */
}
1. 现在网页中普遍使用14px+。
2. 尽量使用偶数的数字字号。ie6等老式浏览器支持奇数会有bug。
3. 各种字体之间必须使用英文状态下的逗号隔开。
4. 中文字体需要加英文状态下的引号,英文字体一般不需要加引号。当需要设置英文字体时,英文字体名必须位于中文字体名之前。
5. 如果字体名中包含空格、#、$等符号,则该字体必须加英文状态下的单引号或双引号,例如font-family: "Times New Roman";。
6. 尽量使用系统默认字体,保证在任何用户的浏览器中都能正确显示。
a { /*font-weight: bold; 字体加粗*/ font-weight: 700; /* 字体加粗 700 == bold */ } h1 { /*font-weight: normal; 让粗体不加粗*/ font-weight: 400; /*让粗体不加粗400 == normal 建议用数值*/ text-align: center; /*让h1 里面的文字水平居中*/ } span { /*color: #ff0000;*/ color: #FDD000; } div { text-align: center; } .nub { color: #f00; font-weight: 400; /*不加粗*/ }
em {
color: skyblue;
font-style: normal; /*让斜体不倾斜*/
}
7月16日是燕京啤酒<em>[微博]</em>2017中国足协杯第三轮比赛
/*选择器{font: font-style font-weight font-size/line-height font-family;}*/
h1 {
/*font: 400 25px "宋体";*/
font: 12px "微软雅黑";
}
--
004.前端开发知识,前端基础CSS(2020-01-09)
原文:https://www.cnblogs.com/hzjdpawn/p/12170974.html