HTML表單基本格式與代碼

來源:互聯網
上載者:User

標籤:check   pass   命名   span   set   英語   checkbox   image   reset   

咱們先來看下今天咱們需要學習的內容,理解起來很簡單,像我這種英語不好的只是需要背幾個單詞

在HTML中建立表單需要用到的最基本的代碼和格式

 1 <form method="post/get" > 2 <!--文本輸入--> 3 <input type="text" />    <!--文字框--> 4 <input type="password" />    <!--密碼框--> 5 <input type="hidden" />    <!--隱藏欄位--> 6 <textarea></textarea>    <!--文本域--> 7 <!--按鈕輸入--> 8 <input type="submit" />    <!--提交按鈕--> 9 <input type="button />    <!--普通按鈕-->10 <input type="image" />    <!--圖片按鈕-->11 <input type="reset" />    <!--重設按鈕-->12 <!--選擇輸入-->13 <input type="redio" name="" checked="checked" value="" />    <!--name是用來分組的,checked是預設值,value是命名按鈕名字的-->14 <input type="checkbox" name="" checked="checked" value=""/>    <!--複選或者是多選-->15 <input type="file" />    <!--上傳圖片-->16 <select>    <!--下拉式功能表-->17 <option value="值">內容</option>18 <option value="值">內容</option>19 <option value="值">內容</option>20 <option value="值">內容</option>21 </select>22 </form>

以上就是咱們需要記住的一點東西

看起來很複雜、很麻煩

咱們來理一下思路

總共分為三大類,每類分為四種,拋出textarea\select剩下的都是input tpye= 這個樣式開頭的

那 文本類的就是下面的四個

input type="text"

.................password

.................hidden

<textarea><textarea/>

 

按鈕類的

input type="submit"

..................button

..................reset

..................image

 

選擇輸入

input type="redio"

..................checkbox

..................file

<select><option></option></select>

 

最後後咱們來補充一個,小內容,關於選擇類和按鈕類的綜合體

咱們在一些網站去註冊的帳號的時候,咱們選擇選項比如說男、女,不一定非要點擊按鈕才可以,點擊漢字也能選擇的上,那這個小技巧是什麼,咱們往下看

<lable for="id">按鈕內容</lable>

1 <input type="redio" name="" checked="checked" value="男" id="001"/>2 <lable for="001">男</lable>

那這樣咱們去點擊前面的按鈕也可以,點擊這個字“男”也可以選擇上,省去了滑鼠、觸摸板使用時的很多不必要的麻煩

HTML表單基本格式與代碼

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.