<input>的maxlength、size属性----<fieldset>与<legend>
生活随笔
收集整理的這篇文章主要介紹了
<input>的maxlength、size属性----<fieldset>与<legend>
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
1、<input>文本框的maxlength、size屬性
- maxlength:文本框中可輸入的字符串最大長度
- size:文本框的尺寸(大小)
2、表單中的<fieldset>與<legend>
- 當一組表單元素放到 標簽內時,瀏覽器會以特殊方式來顯示它們,它們可能有特殊的邊界、3D 效果,或者甚至可創建一個子表單來處理這些元素。
- legend標簽為 fieldset 元素定義標題。
3、例:
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>注冊</title> </head> <body><fieldset><legend>注冊新用戶</legend><form action="#" method="post"><table cellpadding="2" align="center"><tr><td align="right">用戶名:</td><td><input type="text" name="username" maxlength="32" size="32"></td></tr><tr><td align="right">密碼:</td><td><input type="password" name="password" maxlength="18" size="32"></td></tr><tr><td align="right">性別:</td><td><input type="radio" name="gender" value="male" id="male"><labelfor="male">男</label> <input type="radio" name="gender"value="female" id="female"><label for="female">女</label></td></tr><tr><td align="right">興趣:</td><td><input type="checkbox" name="hobby" value="read" id="h1"><labelfor="h1">讀書</label> <input type="checkbox" name="hobby"value="run" id="h2"><label for="h2">跑步</label> <inputtype="checkbox" name="hobby" value="playGame" id="h3"><labelfor="h3">玩游戲</label> <input type="checkbox" name="hobby"value="date" id="h4"><label for="h4">約會</label></td></tr><tr><td align="right">頭像:</td><td><input type="file" name="photo"></td></tr><tr><td colspan="2" align="center"><input type="submit" value="注冊"><input type="reset" value="重填"></td></tr></table></form></fieldset> </body> </html>效果圖:
總結
以上是生活随笔為你收集整理的<input>的maxlength、size属性----<fieldset>与<legend>的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 之前帮朋友写的一个小工具-征途2新浪卡全
- 下一篇: 请注意了!你的APP可能有下架风险,途牛