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,感谢您对本站的认可!
本文链接:https://www.wtabcd.cn/zhishi/a/167767758184055.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文word下载地址:fontweight(fontweight属性).doc
本文 PDF 下载地址:fontweight(fontweight属性).pdf
| 留言与评论(共有 0 条评论) |