html學習筆記四

來源:互聯網
上載者:User

標籤:style   blog   io   ar   color   sp   java   for   strong   

表單標籤<form> :必須記住

表單在html中很常用,因為它可以和電腦互動

input部分

 <font-color = "red" font-size = 10>註冊表單</font><hr/>        <!--表單中的內容要想提交到服務端,因為服務端無法解析,so就必須加標識 name value-->       <form>   <!--用type來定義輸入的屬性-->           輸入帳號:<input type="text" name = "user" value=""/> <br/>           輸入密碼:<input type="password" name="psw" /> <br/><!--passward是非明文資訊-->           選擇性別:<input type="radio" name="sex" value="nan"/>男           <input type="radio" name="sex" value="nv"/>女<br/>           <!--radio是單選框,若name的值不同,是兩組,相同是一組,只能選一個-->           選擇性別:<input type="radio" name="sex"/>男           <input type="radio" name="sex" checked="chexked"/>女<br/><!--checked預設被選中-->            複選框:<input type="checkbox" name="tech" value="Java" checked="checked" />Java                  <input type="checkbox" value="C++"/>C++                  <input type="checkbox" value="C"/>C                  <input type="checkbox" value="Python"/>Python                  <input type="checkbox" value="Ruby"/>Ruby<br/>           選擇檔案:<input type="file" name="file" value=""><br/>           圖片提交:<input type="image" src="2.jpg"> <br/><!--用圖片表徵圖來提交資料-->           <!--隱藏組件開發常用,資料不需要用戶端知道。但是伺服器需要記錄-->           隱藏組件:<input type="hidden" name="Myname" value="Myvalue" /><br/>           我的按鈕:<input type="button" value="按鈕" onclick="alert('你好,世界')"/> <br/>           提交結果:<!--<input type="reset"/><input type="submit"/><br/>-->                  <input type="reset" value=" 重新填寫 " /><!--其實就是表單資料的狀態還原-->                  <input type="submit" value="提交結果" />       </form>

<!--向服務端提交資料,表單中的內容必須有name和value屬性
 

用於給服務端擷取資料-->

input  上述方法,都必須記住

select和textarea部分

<!--選擇部分-->           <select name="country"><!---->               <option>--選中城市--</option>               <option value="TieLing">鐵嶺</option>               <option value="WeiHai"> 威海</option>               <option value="ZiBo" selected="selected">淄博</option>               <!--selected 預設淄博-->           </select><br/><br/><br/>            <!--簡歷-->           <textarea name="text">           </textarea><br/>



表單格式化

<form>           <table border="2" bordercolor="#00fff" cellpadding="10" cellspacing="0" width="600tx">               <tr>                   <th colspan="2">註冊表單:</th>               </tr>               <tr>                   <td>使用者名稱稱:</td>                   <td><input type="text" name="user" /></td>               </tr>               <tr>                   <td>輸入密碼:</td>                   <td><input type="password" name="pwd" /></td>               </tr>               <tr>                   <td>選擇性別:</td>                   <td>                       <input type="radio" name="sex" value="nan">男                       <input type="radio" name="sex" value="nv">女                   </td>               </tr>               <tr>                   <td>選擇技術</td>                   <td>                       <input type="checkbox" name="tech" value="Java">Java                       <input type="checkbox" name="tech" value="C++">JC++                       <input type="checkbox" name="tech" value="C">C                       <input type="checkbox" name="tech" value="Python">Python                       <input type="checkbox" name="tech" value="Ruby">Ruby                   </td>               </tr>               <tr>                   <td>選擇籍貫</td>                   <td>                       <select name="country" >                           <option value="none">--選擇城市--</option>                           <option value="TieLing">鐵嶺</option>                           <option value="WeiHai">威海</option>                           <option value="ZiBo" selected="selected" >淄博</option>                       </select>                   </td>               </tr>               <tr>                   <th colspan="2">                       <input type="reset" value="清楚資料">                       <input type="submit" value="資料提交">                   </th>               </tr>           </table>       </form>





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.