font-weight: bolder;是什么意思
font-weight的示例
示例1演示了font-weight屬性所描述的關鍵字所對應的一般效果,這里選擇Windows常用的Times New Roman字體作為演示效果,如圖1所示。
示例1
<html>
<head>
<title>CSS Demo</title>
<style>
body,table,tr,td { font-family: Times New Roman, Times;
font-size: 18pt; }
table { border-collap: collap; }
</style>
</head>
<body>
<table border=1 cellpadding=5>
<tr><th>關鍵字</th><th>效果</th></tr>
<tr style=font-weight: normal;><td>normal</td><td>The quick brown fox jumps over a lazy dog.</td></tr>
<tr style=font-weight: bold;><td>bold</td><td>The quick brown fox jumps over a lazy dog.</td></tr>
<tr style=font-weight: bolder;><td>bolder</td><td>The quick brown fox jumps over a lazy dog.</td></tr>
<tr style=font-weight: lighter;><td>lighter</td><td>The quick brown fox jumps over a lazy dog.</td></tr>
<tr style=font-weight: 100;><td>100</td><td>The quick brown fox jumps over a lazy dog.</td></tr>
<tr style=font-weight: 200;><td>200</td><td>The quick brown fox jumps over a lazy dog.</td></tr>
<tr style=font-weight: 300;><td>300</td><td>The quick brown fox jumps over a lazy dog.</td></tr>
<tr style=font-weight: 400;><td>400</td><td>The quick brown fox jumps over a lazy dog.</td></tr>
<tr style=font-weight: 500;><td>500</td><td>The quick brown fox jumps over a lazy dog.</td></tr>
<tr style=font-weight: 600;><td>600</td><td>The quick brown fox jumps over a lazy dog.</td></tr>
<tr style=font-weight: 700;><td>700</td><td>The quick brown fox jumps over a lazy dog.</td></tr>
<tr style=font-weight: 800;><td>800</td><td>The quick brown fox jumps over a lazy dog.</td></tr>
<tr style=font-weight: 900;><td>900</td><td>The quick brown fox jumps over a lazy dog.</td></tr>
</table>
</body>
</html>
css里的font-weight:500 以下的都沒效果。但是輸600以上的都可以看見自己加粗了。這是怎么回事
css里的font-weight:500 以下的都沒效果。但是輸600以上的都可以看見自己加粗了是設置錯誤造成的,解決方法為:
1、新建一個html文件,命名為test.html。
2、在test.html文件內,使用div標簽創建一行文字,用于測試。
3、在test.html文件內,給div標簽添加一個class屬性,屬性值為title。
4、在test.html文件內,編寫<style type="text/css"></style>標簽,頁面的css樣式將寫在該標簽內。
5、在css標簽內,通過class設置div的樣式,定義其font-weight屬性為bolder,即可實現加粗,同時,使用font-size屬性設置文字的大小為20px。
css中 FONT-WEIGHT:bold 什么意思?
這句直接翻譯就是:字體粗細:粗體
在CSS中,font-weight 屬性設置文本的粗細。
使用 bold 關鍵字可以將文本設置為粗體。
關鍵字 100 ~ 900 為字體指定了 9 級加粗度。如果一個字體內置了這些加粗級別,那么這些數字就直接映射到預定義的級別,100 對應最細的字體變形,900 對應最粗的字體變形。數字 400 等價于 normal,而 700 等價于 bold。
如果將元素的加粗設置為 bolder,瀏覽器會設置比所繼承值更粗的一個字體加粗。與此相反,關鍵詞 lighter 會導致瀏覽器將加粗度下移而不是上移。
可能的值:
例:
<styletype="text/css">
p.normal{font-weight:normal}
p.thick{font-weight:bold}
p.thicker{font-weight:900}
</style>
參考資料:http://www.w3school.com.cn/css/css_font.asp
文字的粗細:font-weight屬性
本文發布于:2023-02-28 20:28:00,感謝您對本站的認可!
本文鏈接:http://www.newhan.cn/zhishi/a/167767758184055.html
版權聲明:本站內容均來自互聯網,僅供演示用,請勿用于商業和其他非法用途。如果侵犯了您的權益請與我們聯系,我們將在24小時內刪除。
本文word下載地址:fontweight(fontweight屬性).doc
本文 PDF 下載地址:fontweight(fontweight屬性).pdf
| 留言與評論(共有 0 條評論) |