HTML速查列表是一種用于提供HTML標簽的快速參考的工具,這些標簽可以用于創(chuàng)建網(wǎng)頁。這個列表可以被打印出來,以便在日常生活中方便記憶和使用。它包括HTML的基本文檔結構,例如`<DOCTYPE html>`, `<html>`, `<head>`, `<title>`等,以及各種基本標簽,如標題標簽`<h1>`到`<h6>`,段落標簽`<p>`,換行標簽`<br>`和水平線標簽`<hr>`等。此外,它可能還包含文本格式化和注釋的相關信息。
一、HTML基本文檔
<html> <head> <title>文檔標題</title> </head> <body> 可見文本... </body> </html>
二、基本標簽
<p>這是一個段落。</p> <br> (換行) <hr> (水平線) <!-- 這是注釋 --> <h#>標題</h#>
<h1>最大的標題</h1> <h2> . . . </h2> <h3> . . . </h3> <h4> . . . </h4> <h5> . . . </h5> <h6>最小的標題</h6>
三、鏈接
- a:普通鏈接;
- img:圖像鏈接;
- mailto:郵件鏈接;
- abbr:縮寫;
- address:聯(lián)系信息;
- bdo:文字方向;
- blockquote:從另一個源引用的部分;
- cite:工作的名稱;
- del:刪除的文本;
- ins:插入的文本;
- sub:下標文本;
- sup:上標文本。
例如:
普通的鏈接:<a href="鏈接地址" rel="external nofollow" >鏈接文本</a> 圖像鏈接: <a rel="external nofollow" rel="external nofollow" target="_blank" ><img src="URL" alt="替換文本"></a> 郵件鏈接: <a href="mailto:webmaster@example.com" rel="external nofollow" >發(fā)送e-mail</a> 書簽: <a id="tips"> 提示部分</a> <a href="#tips" rel="external nofollow" >跳到提示部分</a>
四、文本格式化
- b:粗體文本
- code:計算機代碼;
- em:強調(diào)文本;
- i:斜體文本;
- kbd:鍵盤輸入;
- pre:預格式化文本;
- small:更小的文本;
- strong:重要的文本;
- abbr:縮寫;
- address:聯(lián)系信息;
- bdo:文字方向;
- blockquote:從另一個源引用的部分;
- cite:工作的名稱;
- del:刪除的文本;
- ins :插入的文本;
- sub:下標文本;
- sup:上標文本。
五、樣式/區(qū)塊
- style:內(nèi)聯(lián)樣式元素,用于定義CSS樣式;
- div:文檔中的塊級元素;
- span:文檔中的內(nèi)聯(lián)元素。
<style type="text/css"> h1 {color:red;} p {color:blue;} </style>
六、圖片
- img:圖片元素,需要指定alt屬性作為替換文本,height和width屬性設置圖片高度和寬度。
<img src="URL" alt="替換文本" height="42" width="42">
七、表格
- table:表格元素,border屬性設置邊框寬度;
- tr:表格行元素;
- th:表格標題單元格元素;
- td:表格數(shù)據(jù)單元格元素。
<table border="1"> <tr> <th>表格標題</th> <th>表格標題</th> </tr> <tr> <td>表格數(shù)據(jù)</td> <td>表格數(shù)據(jù)</td> </tr> </table>
八、框架
- iframe:內(nèi)嵌框架元素,可以嵌入其他網(wǎng)頁或文檔。
<iframe src="demo_iframe.htm"></iframe>
九、表單
- form:表單元素,action屬性指定提交表單時的目標URL,method屬性指定提交方式(post或get);
- input:輸入框元素,type屬性指定輸入類型(text、password、checkbox、radio、submit、reset、hidden、select等);
- select:選擇框元素,option子元素表示選項;
- textarea:文本區(qū)域元素,rows和cols屬性設置行數(shù)和列數(shù)。
<form action="demo_form.php" method="post/get"> <input type="text" name="email" size="40" maxlength="50"> <input type="password"> <input type="checkbox" checked="checked"> <input type="radio" checked="checked"> <input type="submit" value="Send"> <input type="reset"> <input type="hidden"> <select> <option>123</option> <option selected="selected">456</option> <option>789桃</option> </select> <textarea name="comment" rows="60" cols="20"> </textarea> </form>
十、定義列表
- dl:定義列表元素,包含dt和dd子元素.
<dl> <dt>項目 1</dt> <dd>描述項目 1</dd> <dt>項目 2</dt> <dd>描述項目 2</dd> </dl>
十一、有序列表
- li:列表項元素;
- ol:有序列表元素。
<ol> <li>第一項</li> <li>第二項</li> </ol>
十二、無序列表
- ul:無序列表元素。
<ul> <li>項目</li> <li>項目</li> </ul>
十三、實體
- < 等同于 <
- > 等同于 >
- ? 等同于 ©