|
|
| 常用写法 |
| 定义文档类型,写在html文件顶部 | <!DOCTYPE html>
| |
| 定义 HTML 文档。 | <html> <head> <title>文档的标题</title> </head> <body> 文档的内容... ... </body> </html> | |
| 定义关于文档的信息。 | <head> <title>文档的标题</title> </head> | |
| 定义关于 HTML 文档的元信息。 | <!-- 设置编码格式 --> <meta charset="UTF-8"> | |
| 定义文档的标题。 | <title>文档的标题</title> | |
| 定义文档的样式信息。 | <!-- 在html文件内的head头部中定义样式 --> <style type="text/css"> h1 {color:red} p {color:blue} </style> | |
| 定义文档与外部资源的关系。 | <!-- 链接css文件(theme.css) --> <link rel="stylesheet" type="text/css" href="theme.css" /> | |
| 定义文档的主体。 | <body> 文档的内容... ... </body> | |
| 定义 HTML 标题。 | <h1>这是标题 1</h1> <h2>这是标题 2</h2> | |
| 定义段落。 | <p>这是段落</p> | |
| 定义锚。(超链接) | <a href="http://www.w3school.com.cn">W3School</a> | |
| 定义图像。 | <img src="/i/eg_tulip.jpg" alt="上海鲜花港 - 郁金香" /> | |
| 定义表格。 | <table border="1"> <tr> <th>Month</th> <th>Savings</th> </tr> <tr> <td>January</td> <td>$100</td> </tr> </table> | |
| 定义表格标题。 | <caption>Monthly savings</caption> | |
| 定义表格中的表头内容。 | <thead> <tr> <th>Month</th> <th>Savings</th> </tr> </thead> | |
| 定义表格中的表头单元格。 | <th>Savings</th> | |
| 定义表格中的主体内容。 | <tbody> <tr> <td>January</td> <td>$100</td> </tr> </tbody> | |
| 定义表格中的行。 | <tr> <td>January</td> <td>$100</td> </tr> | |
| 定义表格中的单元。 | <td>$180</td> | |
| 定义表格中的表注内容(脚注)。 | <tfoot> <tr> <td>Sum</td> <td>$180</td> </tr> </tfoot> | |
| 定义供用户输入的 HTML 表单。 | <form action="form_action.asp" method="get"> <p>First name: <input type="text" name="fname" /></p> <p>Last name: <input type="text" name="lname" /></p> <input type="submit" value="Submit" /> </form> | |
| 定义有序列表。 | <ol> <li>Coffee</li> <li>Tea</li> <li>Milk</li> </ol> | |
| 定义列表的项目。 | <li>Milk</li> | |
| 定义无序列表。 | <ul> <li>Coffee</li> <li>Tea</li> <li>Milk</li> </ul> | |
| 定义定义列表。 | <dl> <dt>计算机</dt> <dd>用来计算的仪器 ... ...</dd> <dt>显示器</dt> <dd>以视觉方式显示信息的装置 ... ...</dd> </dl> | |
| 定义定义列表中的项目。 | <dt>计算机</dt> <dd>用来计算的仪器 ... ...</dd> | |
| 定义定义列表中项目的描述。 | <dt>计算机</dt> <dd>用来计算的仪器 ... ...</dd> | |
| 定义输入控件。 | <input type="submit" value="Submit" /> | |
| 定义简单的折行。 | <br /> | |
| 定义被删除文本。 | a dozen is <del>20</del> 12 pieces | |
| 定义文档中的节。 | <div style="color:#00FF00"> <h3>This is a header</h3> <p>This is a paragraph.</p> </div> | |
| 定义文档中的节。 |
| |
| 定义强调文本。文本粗体 |
| |
| 定义强调文本。文本斜体 |
| |
| 定义斜体字。 |
| |
| 定义粗体字。 |
| |
| 定义水平线。 |
| |
| 定义选择列表(下拉列表)。 |
| |
| 定义选择列表中的选项。 |
| |
| 定义多行的文本输入控件。 |
| |
|
|
| |
|
|
|
|
811



被折叠的 条评论
为什么被折叠?



