阅读背景:

CSS学习笔记之字体配置与元素

来源:互联网 

字体:

1.字体
/*网页中的文字设置字体为微软雅黑
为网页中的文字设置字体为宋体。*/
body{font-family:"Microsoft Yahei";}

2.字号 颜色
/*网页中文字的字号为12像素,并把字体颜色设置为#666(灰色)*/
body{font-size:12px;color:#666};
.stress{font-size:20px;color:red;}

3.粗体
/*实现设置文字以粗体样式显示出来*/
p span{font-weight:bold;}

4.斜体
/*实现文字以斜体样式在浏览器中显示*/
p a{font-style:italic;}

5.下划线
/*设置为下划线样式*/
p a{text-decoration:underline;}

6.删除线
 .oldPrice{text-decoration:line-through;}

7.缩进
/*文本段设置2个空格缩进*/
p{text-indent:2em;}

8.间距(行高)属性(line-height)
/*设置行间距(行高)为2em*/
p{line-height:2em;}

9.-中文字间距、字母间距
/*为标题设置字母间距为20像素*/
h1{letter-spacing: 20px;}

10.-对齐 为块状元素中的文本、图片设置居中样式
div{text-align:center;}1.字体
/*网页中的文字设置字体为微软雅黑
为网页中的文字设置字体



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: