HTML常用标签
HTML 基本文档
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <title>文档标题</title> 5 </head> 6 <body> 7 可见文本... 8 </body> 9 </html>
基本标签(Basic Tags)
1 <h1>最大的标题</h1> 2 <h2> . . . </h2> 3 <h3> . . . </h3> 4 <h4> . . . </h4> 5 <h5> . . . </h5> 6 <h6>最小的标题</h6> 7 8 <p>这是一个段落。</p> 9 <br> (换行) 10 <hr> (水平线) 11 <!-- 这是注释 -->
文本格式化(Formatting)
1 <b>粗体文本</b> 2 <code>计算机代码</code> 3 <em>强调文本</em> 4 <i>斜体文本</i> 5 <kbd>键盘输入</kbd> 6 <pre>预格式化文本</pre> 7 <small>更小的文本</small> 8 <strong>重要的文本</strong> 9 10 <abbr> (缩写) 11 <address> (联系信息) 12 <bdo> (文字方向) 13 <blockquote> (从另一个源引用的部分) 14 <cite> (工作的名称) 15 <del> (删除的文本) 16 <ins> (插入的文本) 17 <sub> (下标文本) 18 <sup> (上标文本)
链接(Links)
1 普通的链接:<a href="http://www.example.com/">链接文本</a> 2 图像链接: <a href="http://www.example.com/"><img src="URL" alt="替换文本"></a> 3 邮件链接: <a href="mailto:webmaster@example.com">发送e-mail</a> 4 书签: 5 <a id="tips">提示部分</a> 6 <a href="#tips">跳到提示部分</a>
图片(Images)
1 <img src="URL" alt="替换文本" height="42" width="42">
样式/区块(Styles/Sections)
1 <style type="text/css"> 2 h1 {color:red;} 3 p {color:blue;} 4 </style> 5 <div>文档中的块级元素</div> 6 <span>文档中的内联元素</span>
无序列表
1 <ul> 2 <li>项目</li> 3 <li>项目</li> 4 </ul>
有序列表
1 <ol> 2 <li>第一项</li> 3 <li>第二项</li> 4 </ol>
定义列表
1 <dl> 2 <dt>项目 1</dt> 3 <dd>描述项目 1</dd> 4 <dt>项目 2</dt> 5 <dd>描述项目 2</dd> 6 </dl>
表格(Tables)
1 <table border="1"> 2 <tr> 3 <th>表格标题</th> 4 <th>表格标题</th> 5 </tr> 6 <tr> 7 <td>表格数据</td> 8 <td>表格数据</td> 9 </tr> 10 </table>
框架(Iframe)
1 <iframe src="demo_iframe.htm"></iframe>
表单(Forms)
1 <form action="demo_form.php" method="post/get"> 2 <input type="text" name="email" size="40" maxlength="50"> 3 <input type="password"> 4 <input type="checkbox" checked="checked"> 5 <input type="radio" checked="checked"> 6 <input type="submit" value="Send"> 7 <input type="reset"> 8 <input type="hidden"> 9 <select> 10 <option>苹果</option> 11 <option selected="selected">香蕉</option> 12 <option>樱桃</option> 13 </select> 14 <textarea name="comment" rows="60" cols="20"></textarea> 15 16 </form>
实体(Entities)
1 < 等同于 < 2 > 等同于 > 3 © 等同于 ©
摘抄于菜鸟教程