1 <!DOCTYPE html> 2 <html lang="en"> 3 <head> 4 <meta charset="UTF-8"> 5 <title>CSS</title> 6 <style type="text/css"> 7 .test { 8 font: italic small-caps bold 28px/34px "微软雅黑"; 9 } 10 </style> 11 </head> 12 <body> 13 <p class="title">font 属性</p> 14 <p>格式:font:[ [ <"font-style"> || <"font-variant"> || <"font-weight"> ]? <"font-size"> [ / <"line-height"> 15 ]? <"font-family"> ] </p> 16 <table> 17 <tr> 18 <td><"font-style">:</td> 19 <td>指定文本字体样式</td> 20 <td>可选属性:</td> 21 <td>normal | italic | oblique</td> 22 </tr> 23 <tr> 24 <td><"font-variant">:</td> 25 <td>指定文本是否为小型的大写字母</td> 26 <td>可选属性:</td> 27 <td>normal | small-caps</td> 28 </tr> 29 <tr> 30 <td><"font-weight">:</td> 31 <td>指定文本字体的粗细</td> 32 <td>可选属性:</td> 33 <td>normal | bold | bolder | lighter | <integer></td> 34 </tr> 35 <tr> 36 <td><"font-size">:</td> 37 <td>指定文本字体尺寸</td> 38 <td>可选属性:</td> 39 <td>absolute-size> | <relative-size> | <length> | <percentage></td> 40 </tr> 41 <tr> 42 <td><"line-height">:</td> 43 <td>指定文本字体的行高</td> 44 <td>可选属性:</td> 45 <td>normal | <length> | <percentage> | <number></td> 46 </tr> 47 <tr> 48 <td><"font-family">:</td> 49 <td>指定文本使用某个字体或字体序列</td> 50 <td>可选属性:</td> 51 <td>[ <family-name> | <generic-family> ]</td> 52 </tr> 53 </table> 54 <h1 class="test">This is test text.</h1> 55 </body> 56 </html>
时间: 2024-10-01 07:42:03