CSS - Typography

Font:

我们可以使用css样式为网页中的文字设置字体、字号、颜色等样式属性。下面代码实现:
为网页中的文字设置字体为宋体。
body{font-family:"宋体";}
这里注意不要设置不常用的字体,因为如果用户本地电脑上如果没有安装你设置的字体,
就会显示浏览器默认的字体。(因为用户是否可以看到你设置的字体样式取决于用户本地
电脑上是否安装你设置的字体。)
现在一般网页喜欢设置“微软雅黑”,如下代码:
body{font-family:"Microsoft Yahei";}

Font size and color:

可以使用下面代码设置网页中文字的字号为12像素,并把字体颜色设置为#666(灰色):
body{font-size:12px;color:#666}

We can also use css styles to change the style of the text: bold, italic, underline, strikethrough:

可以使用下面代码实现设置文字以粗体样式显示出来:
span{font-weight:bold;}
以下代码可以实现文字以斜体样式显示:
span{font-style:italic;}
使用下面代码来实现下划线样式:
span{text-decoration:underline;}
用下面代码实现设置删除线:
span{text-decoration:line-through;}

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325707451&siteId=291194637
css