详细介绍:
在CSS中,可以通过font-weight属性来设置字体的粗细。
属性值:
-
normal 默认值。定义标准的字符。
-
bold 定义粗体字符。
-
bolder 定义更粗的字符。
-
lighter 定义更细的字符。
html示例:
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Document</title> <style type="text/css"> .lighter { font-weight: lighter; } .normal { font-weight: normal; } .bold { font-weight: bold; } .bolder { font-weight: bolder; } </style> </head> <body> <p class="lighter">字体粗细:lighter</p> <p class="normal">字体粗细:normal</p> <p class="bold">字体粗细:bold</p> <p class="bolder">字体粗细:bolder</p> </body> </html>
运行结果:
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。
评论(0)