font-weight
  • 提交:admin
  • 时间:08-10-07 15:38
  • 更新:08-10-07 15:38
字体加粗font-weight
在HTML里可以使用<b>加粗字体,在CSS中使用font-weight设置字体的粗细。
语法格式如下:

font-weight:normal | bold | bolder | lighter | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900
说明:
normal:是浏览器的默认字体,字体为7,字体粗细为400。
bold:粗体,字体粗细为700。
bolder:粗体加粗,字体粗细为900。
lighter:比默认字体还细。
100—900:数字越小越细,反之越粗。

利用font-weight设置字体的粗细,其效果如下:
<html>
<style type="text/css">
<!--
#w-normal {font-weight:normal}
#w-bold {font-weight:bold}
#w-bolder {font-weight:bolder}
#w-lighter {font-weight:lighter}
#w-1 {font-weight:100}
#w-2 {font-weight:200}
#w-3 {font-weight:300}
#w-4 {font-weight:400}
#w-5 {font-weight:500}
#w-6 {font-weight:600}
#w-7 {font-weight:700}
#w-8 {font-weight:800}
#w-9 {font-weight:900}
-->
</style>
<head>
<title>这是CSS字体属性font-weight的实例</title>
</head>
<body bgcolor=lightyellow>
<center>
<font size=5 color=red>这是CSS字体属性font-weight的效果实例</font>
<table border=2>
<tr align=center>
<td id=w-lighter>lighter</td>
<td id=w-normal>normal</td>
<td id=w-bold>bold</td>
<td id=w-bolder>bolder</td>
</tr>
<tr>
<td id=w-1>字体粗细为100</td> <td id=w-4>字体粗细为400</td>
<td id=w-5>字体粗细为500</td> <td id=w-8>字体粗细为800</td>
</tr>
<tr>
<td id=w-2>字体粗细为200</td> <td>&nbsp</td>
<td id=w-6>字体粗细为600</td> <td id=w-9>字体粗细为900</td>
</tr>
<tr>
<td id=w-3>字体粗细为300</td> <td>&nbsp</td>
<td id=w-7>字体粗细为700</td> <td>&nbsp</td>
</tr>
</table>
</center>
</body>
</html>
本课主题:CSS字体属性font-weight

相关主题:
font-variant
font-style
font-family
css特性
span标签
div标签
请拨打热线:0571-86586571

文章推荐

    Loading...

人气排行

    Loading...
建站经验 - 业内新闻 - 优化技术 - 网络营销 - 官方论坛 - 建站套餐 - 网站建设单价 - 增值服务 - 建站流程
网站优化套餐 - 网站推广增值服务 - 网站推广流程 - 网站设计 - 设计精选 - 企业网站 - 政府网站 - 电子商务网站 - 行业门户网站

关于我们 - 诚聘英才 - 合作伙伴 - 联系我们
[ 简体中文 ] [ blue ] 管理模式
Copyright ©2005 - 2008 杭州尚线网络技术有限公司
Processed in 0.004(s) 浙ICP备07025542号