当前阅读教程:CSS入门到精通 > 字体粗细 font-weight | |||||||||||||||||||||||
阅读(22555525) 收藏 赞(5685) 分享 | |||||||||||||||||||||||
上一篇: 小型大写字体 font-variant属性 | 下一篇: 所有的字体 font属性 | ||||||||||||||||||||||
浏览器支持表格中的数字表示支持该属性的第一个浏览器版本号。 属性定义及使用说明font-weight 属性设置文本的粗细
属性值
示例代码<!doctype html> <html> <head> <meta charset="utf-8"> <title>字体粗细 font-weight</title> <!--定义内部样式--> <style> .css1{ font-weight: normal;/*400 等同于 normal*/ } .css2{ font-weight: lighter; } .css3{ font-weight: bold;/* 700 等同于 bold*/ } .css4{ font-weight:bolder; } .css5{ font-weight: 900; } </style> </head> <body> <p>这是一个段落,浏览器中默认的文字大小是16px</p><hr>
<p>这是一个段落,字体大小font-weight:normal</p> <p>这是一个段落,字体大小font-weight:lighter</p> <p>这是一个段落,字体大小font-weight:bold</p> <p>这是一个段落,字体大小font-weight:bolder</p> <p>这是一个段落,字体大小font-weight:900</p> </body> </html> 效果图 |
|||||||||||||||||||||||
上一篇: 小型大写字体 font-variant属性 | 下一篇: 所有的字体 font属性 |