h1h2h3h45h5h6是标准的HTML标签,其中h1最大,h6最小,主要用于标题,合理应用,能更好更快地被搜索引擎收录。在E文的网页中很容易使用,由于中文的字体如果大于14PX的话,会不太好看,所以需在CSS中设定一下。
H1-H6和其他尺寸的对照表,来源:http://www.w3.org/TR/CSS21/fonts.html .
CSS absolute-size values | xx-small | x-small | small | medium | large | x-large | xx-large | |
---|---|---|---|---|---|---|---|---|
HTML headings | h6 | h5 | h4 | h3 | h2 | h1 | ||
HTML font sizes | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
eg1:基本设置
h1,h2,h3,h4,h5,h6{ margin:0px; /*h1-h6默认有空白,设定外补丁的值为零,以后容易调整。*/ }
eg2:把你的网站名称放在H1或者H2标签中
Fifty Studio
h2{ padding:10px; text-align:center; font-size:16px; }
eg3:带背景和边框的H4标签
About Us
h4{ border-left: 6px solid #DC4E1B; line-height: 20px; background: #E9E9E9; padding-left: 12px; font-size: 12px; }