欢迎来到DIVCSS5查找CSS资料与学习DIV CSS布局技术!
  1、设置文字字体——font-family
 
  属性值建议用英文黑体Arial;
 
  微软雅黑“MicrosoftYahei”;
 
  宋体“SimSun”提高加载速度;
 
  设置可选字体用逗号隔开)
 
  index.html
 
  <!doctypehtml>
 
  <html>
 
  <head>
 
  <metacharset="utf-8"/>
 
  <title>字体</title>
 
  <linkhref="index.css"type="text/css"rel="stylesheet"/>
 
  </head>
 
  <body>
 
  <p>
 
  设置文字字体属性值建议用英文黑体Arial;微软雅黑“MicrosoftYahei”;
 
  宋体“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;}





本文转载自中文网

 

如需转载,请注明文章出处和来源网址:http://www.divcss5.com/css3-style/c55543.shtml