1、设置文字字体——font-family
属性值建议用英文黑体Arial;
微软雅黑 “Microsoft Yahei”;
宋体“SimSun”提高加载速度;
设置可选字体用逗号隔开)
index.html
<!doctype html>
<html>
<head>
<meta charset="utf-8"/>
<title>字体</title>
<link href="index.css" type="text/css" rel="stylesheet"/>
</head>
<body>
<p>
设置文字字体属性值建议用英文黑体Arial; 微软雅黑 “Microsoft Yahei”;
宋体“SimSun”;提高加载速度;设置可选字体用逗号隔开
</p>
</body>
</html>index.css
p{ font-family:"SimSun";}2.设置文字大小——font-size
index.css
p{ font-size:21px;}3.设置文字为粗体——font-weight
属性值:normal;正常
bold/bolder;加粗
index.css
p{ font-weight:bold;}4.设置文字为斜体——font-style
属性值:italic;
index.css
p{ font-style:italic;}5.设置英文为小型的大写字母字体
index.css
p{font-variant: small-caps;}6.设置文字颜色
index.css
p{ color:lightgreen;}7.设置文字背景颜色
index.css
p{ background-color:lightblue;}相关推荐:
CSS属性之字体(Font)_html/css_WEB-ITnose
网页CSS样式属性:font字体常识_html/css_WEB-ITnose
以上就是css文字样式中属性的介绍(附代码)的详细内容,更多请关注php中文网其它相关文章!
……