語義:標記表單html
#一、什麼是表單? 表單就是專門用來接收用戶輸入或採集用戶信息的 #二、表單的格式 <form> <表單元素> </form>
連接:https://www.processon.com/view/link/5aeea789e4b084d6e4bf6911 python
圖片:https://pan.baidu.com/s/1db6o--q557aKmtYJSBsyqAspa
在form內還能夠添加一種標籤 <fieldset>添加邊框 <legend>註冊頁面</legend> 表單控件...... </fieldset>
<html> <head> <title>表單練習</title> <meta charset="utf-8"/> </head> <body> <form action="http://www.baidu.com"> <fieldset> <legend>註冊頁面</legend> <p> 帳號:<input type="text" placeholder="請輸入你的用戶名" name="user"> </p> <p> 密碼:<input type="password" placeholder="請輸入你的密碼" name="password"> </p> <p> 性別: <input type="radio" name="gender" value="male">男 <input type="radio" name="gender" value="female">女 <input type="radio" name="gender" checked="checked" value="none">保密 </p> <p> <!--注意點:單選框or複選框都須要指定相同的name值--> 愛好: <input type="checkbox" name="sport" value="basketball">籃球 <input type="checkbox" name="sport" value="football">足球 <input type="checkbox" checked="checked" name="sport" value="crazy">足浴 </p> <p> 簡介: <textarea name="" id="" cols="30" rows="10" name="desc"></textarea> </p> <p> 生日: <input type="date" name="birth"> </p> <p> 郵箱: <input type="email" name="email"> </p> <p> 電話: <input type="number" name="phone"> </p> <p> <input type="submit" value="註冊"> <input type="reset" value="清空"> </p> </fieldset> </form> </body> </html>