css讓字體變細的方法:可以利用font-weight屬性來實現(xiàn),如【font-weight: lighter;】。font-weight屬性是用來設置字體的粗細效果的,屬性值lighter表示更細的字符。
本文操作環(huán)境:windows10系統(tǒng)、css 3、宏基S40-51。
詳細介紹:
在CSS中,可以通過font-weight屬性來設置字體的粗細。
(學習視頻分享:html視頻教程)
屬性值:
-
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>
運行結果: