溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點(diǎn)擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

HTML開發(fā)基礎(chǔ)

發(fā)布時(shí)間:2020-07-08 14:15:25 來源:網(wǎng)絡(luò) 閱讀:522 作者:yht_1990 欄目:開發(fā)技術(shù)

常用標(biāo)簽

1、各種符號

2、p和br

3、a標(biāo)簽

4、H標(biāo)簽

5、select

6、input:checkbox

7、input:radio

8、input:password

9、input:button

10、input:file

11、textarea

12、label

13、ul or dl

14、table

15、fieldset

16、form

17、div


HTML代碼演示

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8" />
        <title>頁面一</title>
    </head>
    <body>
        <!-- div和span演示 -->  
        <div>這是div塊級標(biāo)簽,占一行寬度</div>    
        <div>再寫一行,再占一行塊級標(biāo)簽</div>   
        <span>這是span內(nèi)聯(lián)標(biāo)簽,占字符寬度大小</span>   
        <span>再寫一行內(nèi)聯(lián)標(biāo)簽,從左到右堆疊著一排放</span>
        <!-- 特殊字符演示 -->  
        <div>&lt;div&gt; </div>
        <div>&lt;div&gt;&nbsp;</div>  <!-- &lt小于號 &gt大于號 &nbsp空格 這是特殊符號用來顯示特殊內(nèi)容 -->
        
        <!-- p段落標(biāo)簽和br換行演示-->  
        <p>ddddd</p>
        <p>ddddd</p>  <!-- p段落自已換行,換行會空一行出來,這是他的樣式 -->  
        <div>ddddd<br/>ddddd</div>   <!-- <br\>換行 -->
        
        <!-- a標(biāo)簽演示 -->
        <a >wsyht</a>  <!-- href  target為a標(biāo)簽的屬性,_blank為跳轉(zhuǎn)到新頁面打開,屬性可以自定義 -->
        
        <!-- 描述:a標(biāo)簽描演示 -->
        <!--目錄-->
        <div>
        <a href='#id1'>第一章</a>  <!-- 和下面id號相關(guān)聯(lián) -->
        <a href='#id2'>第二章</a>
        <a href='#id3'>第三章</a>
        </div>
         <!--內(nèi)容-->
        <div id="id1">
        <p>第一章內(nèi)容</p>
        <p>第一章內(nèi)容</p>
        <p>第一章內(nèi)容</p>
        <p>第一章內(nèi)容</p>
        <p>第一章內(nèi)容</p>
        <p>第一章內(nèi)容</p>
        <p>第一章內(nèi)容</p>
        <p>第一章內(nèi)容</p>
        <p>第一章內(nèi)容</p>             
        <p>第一章內(nèi)容</p>
        <p>第一章內(nèi)容</p>
        <p>第一章內(nèi)容</p>
        <p>第一章內(nèi)容</p>
        </div>
        <div id="id2" >第二章內(nèi)容</div>  <!-- style樣式,height高,backgroud-colod背影顏色-->
        <div id="id3" >第三章內(nèi)容</div>  
        
        <!-- h2標(biāo)題大小演示-->
        <h2>wsyht</h2>   <!--最大h2最小h7,一共1到6數(shù)字大小-->
        <h7>wsyht</h7>
        
        <!--select下拉框演示-->
        <select>
        <option value="1">佛山</option>
        <option value="2">東莞</option>
        <option value="3" selected="selected">惠州</option>    <!--默認(rèn)是惠州選項(xiàng)-->
        </select>
        <select size="3">             <!--默認(rèn)有3個(gè)選項(xiàng),但只能單選-->
        <option>北京</option>
        <option>上海</option>
        <option>廣州</option>
        </select>
        <select multiple="multiple" size="4">  <!--默認(rèn)有4個(gè)選項(xiàng),可以多選-->
        <option>北京</option>
        <option>上海</option>
        <option>廣州</option>
        <option>深圳</option>    
        </select>
            <select>
                <optgroup label="廣東省"></optgroup>     <!--有廣東省和河北省組,組下還有市可以選-->
                    <option>廣州</option>
                    <option>深圳</option>
                <optgroup label="河北省"></optgroup>
                    <option>石家莊</option>
                    <option>邯鄲</option>
            </select>
        
         <!--input標(biāo)簽演示-->
         <br/>
         <input />  <!--默認(rèn)什么都不加,就是type=text-->
         <br/>
         <input type="text"maxlength="5"/>  <!--輸入框顯示,最多只能輸入5個(gè)字符-->
         <br/>
         <input type="password"/> <!--密碼框-->
         <br/>
         <input type="checkbox"/> <!--復(fù)選框-->
         <input type="checkbox"/> <!--復(fù)選框-->
         <input type="checkbox"/> <!--復(fù)選框-->
         <input type="checkbox"/> <!--復(fù)選框-->
         <input type="checkbox"/> <!--復(fù)選框-->
         <br/>
         男:<input type="radio" name="gender"/> <!--單選框 name屬性設(shè)置成一個(gè)的,那就只能二選一-->
         女:<input type="radio" name="gender"/> <!--單選框-->
        <br/>
        <input type="button" value="提交"/>  <!--button按鈕,背景字為提交,button不會提交數(shù)據(jù)到后臺,而是跟js結(jié)合提交觸發(fā)某一個(gè)動作,如驗(yàn)證碼刷新-->
        <input type="submit" value="提交"/>  <!--submit提交數(shù)據(jù)到后臺,在非from表單中使用不能提交數(shù)據(jù)到后臺-->
        <input type="file" />   <!--file就是上傳文件-->
           
        <!--多行輸入框演示-->
        <textarea>多行輸入框</textarea>
        
        <!--from表單,使用場景:登陸、注冊、修改數(shù)據(jù)、提交數(shù)據(jù)到后臺-->
        <form action="http://127.0.0.1:8080/getdata" method="post">  <!--通過action提交到后臺某個(gè)url,通過post方式提交,有g(shù)et和post兩種方式提交,如果前端用post后端也用post,前后要統(tǒng)一-->
        Name:<input name='username' type="text"/>  <!--通過name做key,你輸入的值作為value發(fā)到后臺-->
        <br/><br/>
        pwd:<input name="pwd" type="password"/>        
        <!--<input type="button" value="提交"/> --> <!--button按鈕,在from表單中不可以使用-->
        <input type="submit" value="提交"/>         <!--submit可以在from表單用,通過submit提交數(shù)據(jù)到后臺-->
        </form>
        
        <!--lobel標(biāo)簽演示-->
        <label for="name2">姓名:<input id="name2" type="text" > </label> <!--用for點(diǎn)擊姓名自動給你加光標(biāo)-->
        
        <!-- 列表演示 -->
        <ul>                 <!--這種格式去寫會在前面加一個(gè)黑點(diǎn)-->
            <li>ul.li</li>
            <li>ul.li</li>
            <li>ul.li</li>
        </ul>
        
        <ol><!--這種格式去寫會自動幫你加序號-->
            <li>ul.li</li>
            <li>ul.li</li>
            <li>ul.li</li>
        </ol>
        
        <dl>                        <!--dl一個(gè)范圍 -->
            <dt>廣東省</dt>         <!--dt標(biāo)題-->
                <dd>廣州</dd>    <!--內(nèi)容-->
                <dd>深圳</dd>
            <dt>河北省</dt>
                <dd>石家莊</dd>
                <dd>邯鄲</dd>
        </dl>
        
        <table border="1">             <!--broder邊框大小-->
        <tr>
            <th>ip</th>            <!--th表格標(biāo)題,默認(rèn)樣式加粗居中-->
            <th>idc</th> 
            <th>status</th>
        </tr>
        <tr>                       <!--tr行-->
            <td>ip</td>           <!--td列-->
            <td>idc</td>
            <td>status</td>
        </tr>
        <tr>
            <td>192.168.1.1</td>
            <td>廣州</td>
            <td>online</td>
            </td>
        </table>
        
        <table border="1">
        <thead><!--tread頭部-->
        <tr>  
            <th>ip</th>            <!--th表格標(biāo)題,默認(rèn)樣式加粗居中-->
            <th>idc</th> 
            <th>status</th>
        <tr>  
           </thead>
        <tbody>                            <!--tbody身體-->
        <tr>                           <!--tr行-->
            <td colspan="2">ip</td>   <!--td列,colspan占2列,左右單元格合并-->
            <td>status</td>
        </tr>    
        <tr>          <!--tr行-->
            <td>ip</td>           <!--td列-->
            <td>idc</td>
            <td>status</td>
        </tr>
        <tr>            <!--tr行-->
            <td rowspan="2">ip</td> <!--rowsapn上下合并--> 
            <td>idc</td>     <!--td列-->
            <td>status</td>
        </tr>  
        <tr>          <!--tr行-->
            <td>idc</td>
            <td>status</td>
        </tr>  
        </tbody>
        </table>
        
        <fieldset>                     
            <legend>登陸</legend>          <!--外邊一個(gè)黑框,包住登陸字體-->
            <p>用戶名:</p>                <!--里面的內(nèi)容為用戶名-->
            <p>密碼:</p>
        </fieldset>
        
        
</body>
</html>


向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI