css讓字體變細(xì)的方法:可以利用font-weight屬性來實(shí)現(xiàn),如【font-weight: lighter;】。font-weight屬性是用來設(shè)置字體的粗細(xì)效果的,屬性值lighter表示更細(xì)的字符。
本文操作環(huán)境:windows10系統(tǒng)、css 3、宏基S40-51。
詳細(xì)介紹:
在CSS中,可以通過font-weight屬性來設(shè)置字體的粗細(xì)。
(學(xué)習(xí)視頻分享:html視頻教程)
屬性值:
-
normal 默認(rèn)值。定義標(biāo)準(zhǔn)的字符。
-
bold 定義粗體字符。
-
bolder 定義更粗的字符。
-
lighter 定義更細(xì)的字符。
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">字體粗細(xì):lighter</p> <p class="normal">字體粗細(xì):normal</p> <p class="bold">字體粗細(xì):bold</p> <p class="bolder">字體粗細(xì):bolder</p> </body> </html>
運(yùn)行結(jié)果: