小白教程
所有教程
关于
Search
172.71.254.8
172.71.254.8
参数设置
贡献
退出
操作
编辑
移动
保护
信息
历史
删除
查看“Pr font font size”的源代码
本页内容
上一节:
Pr_font_font_family
下一节:
Pr_font_font_style
因为以下原因,您没有权限编辑本页:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
{{DISPLAYTITLE:font-size}}[[Category:css reference|123]] = CSS font-size 属性 = 设置不同的HTML元素的字体大小: <sample title="" desc="" lang="html" hererun="1"> h1 {font-size:250%} h2 {font-size:200%} p {font-size:100%} </sample> <run name=""> <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>小白教程(xiaobai.wang)</title> <style> h1 {font-size:250%;} h2 {font-size:200%;} p {font-size:100%;} </style> </head> <body> <h1>This is heading 1</h1> <h2>This is heading 2</h2> <p>This is a paragraph.</p> </body> </html> </run> == 属性定义及使用说明 == font-size 属性用于设置字体大小。 {| class="table table-striped table-hover" | 默认值: | medium |- | 继承: | yes |- | 版本: | CSS1 |- | JavaScript 语法: | object.style.fontSize="larger" |} <sample title="" desc="" lang="html" hererun="1"> /* <absolute-size>,绝对大小值 */ font-size: xx-small; font-size: x-small; font-size: small; font-size: medium; font-size: large; font-size: x-large; font-size: xx-large; /* <relative-size>,相对大小值 */ font-size: larger; font-size: smaller; /* <length>,长度值 */ font-size: 12px; font-size: 0.8em; /* <percentage>,百分比值 */ font-size: 80%; font-size: inherit; </sample> == 浏览器支持 == 表格中的数字表示支持该属性的第一个浏览器版本号。 {| class="table table-striped table-hover" ! 属性 ! Chrome ! Internet Explorer / Edge ! Firefox ! Safari ! Opera |- | font-size | 1.0 | 5.5 | 1.0 | 1.0 | 7.0 |} == 属性值 == {| class="table table-striped table-hover" !width="50%"| 值 !width="50%"| 描述 |- | * xx-small * x-small * small * medium * large * x-large * xx-large | 把字体的尺寸设置为不同的尺寸,从 xx-small 到 xx-large。 默认值:medium。 |- | smaller | 把 font-size 设置为比父元素更小的尺寸。 |- | larger | 把 font-size 设置为比父元素更大的尺寸。 |- | length | 把 font-size 设置为一个固定的值。 |- | % | 把 font-size 设置为基于父元素的一个百分比值。 |- | inherit | 规定应该从父元素继承字体尺寸。 |} == 相关文章 == CSS 教程: [[css font|CSS Font]] CSS 参考手册: [[pr font font|font 属性]]
返回至“
Pr font font size
”。
上一节:
Pr_font_font_family
下一节:
Pr_font_font_style