Input type=“XXX”
Email 郵箱: 提示格式不正確
url 地址 :地址格式:http://www.....
Number:數(shù)值型
屬性:min 最小 max最大
Range: 范圍內(nèi)數(shù)字的輸入域 滑動條 了解
Date: 日期選擇器
Tel :電話號碼的輸入框
Color: 選色器
新增表單屬性:
autocomplete 屬性規(guī)定 form 或 input 域應(yīng)該擁有自動完成功能。 值 on 打開 off 關(guān)閉。
表單提示框autofocus 屬性規(guī)定在頁面加載時,域自動地獲得焦點(diǎn)。autofocus= autofocus 頁面上只有一個
formaction - 重寫表單的 action 屬性 重定向表單提交 控制表單數(shù)據(jù)提交時候,提交到那個頁面進(jìn)行數(shù)據(jù)處理
formmethod - 重寫表單的 method 屬性
image類型的input元素的寬度和高度
height:
width:
list: 屬性規(guī)定輸入域的 datalist
解釋:關(guān)聯(lián)選項(xiàng) input-à關(guān)聯(lián)成下拉列表 datalist list=”val” =è datalist id=”val”
Datalist 所有選項(xiàng)必須 option
Label 提示
Value 下拉列表中出現(xiàn)的值
required 屬性規(guī)定必須在提交之前填寫輸入域(不能為空)。 必填項(xiàng) 可以用在所有的input 類型的元素上。
案例:
Css代碼@charset utf-8 /* CSS Document */*{ margin:0px;padding:0px;}ul,li{ list-style:none;}a{ text-decoration:none;}header{ border:0px solid #ff0000; width:90%; height:80px; margin:0 auto; font-size:50px; background-color:#E9F8FE; text-align:center; line-height:80px; width:90%; height:30px; margin:20px auto; border:0px solid #ff0000; background-color:#8CCFF0; nav ul{ padding-left:30px;}nav ul li{ width:80px; float:left; line-height:30px; font-weight:bold; nav ul li a:hover{ color:#F00;}section{ height:600px; width:90%; border:1px solid #CCC; margin:0 auto; aside{ width:20%; float:left; height:600px; border-right:1px solid #ccc; aside ul{ border:0px solid #00ff00; height:400px; aside ul li a{ color:#000; line-height:40px; border-bottom:1px solid #ccc; text-align:center; display:block; form{ width:75%; float:left; margin-left:10px; padding-left:30px; padding-top:20px;form p{ line-height:30px;}footer{ width:90%; height:100px; text-align:center; margin-top:20px; }
Html代碼 !doctype html html head meta charset= utf-8 title 無標(biāo)題文檔 /title link rel= stylesheet href= css/style.css /head body header XXX科技有限公司出品 /header nav li a href= # 首 nbsp; nbsp; nbsp; nbsp;頁 /a /li li a href= # 關(guān)于我們 /a /li li a href= # 產(chǎn)品介紹 /a /li li a href= # 聯(lián)系我們 /a /li /ul /nav section aside li a href= # 客服中心 /a /li li a href= # 用戶中心 /a /li li a href= # 產(chǎn)品中心 /a /li li a href= # 反饋中心 /a /li /ul /aside form action= 1.html p 用戶名 input type= text name= uName /p p 郵箱 input type= email name= uEmail /p 性別 input type= text list= uSex name= sex datalist id= uSex option value= 男 /option option value= 女 /option /datalist p 手機(jī) input type= tel name= uTel /p p input type= submit value= 注冊 /p /form /section footer 京ICP:111111111 地址:XXXXXX /footer /body /html
H5新增的標(biāo)簽以及作用就這么多了,更多精彩請關(guān)注php 其它相關(guān)文章!
相關(guān)閱讀:
HTML下拉菜單代碼
html 的 header 標(biāo)簽需要怎么使用
HTML5的 footer 標(biāo)簽元素怎么使用
以上就是HTML5的新增了哪些標(biāo)簽元素的詳細(xì)內(nèi)容,html教程
鄭重聲明:本文版權(quán)歸原作者所有,轉(zhuǎn)載文章僅為傳播更多信息之目的,如作者信息標(biāo)記有誤,請第一時間聯(lián)系我們修改或刪除,多謝。
|
新聞熱點(diǎn)
疑難解答
圖片精選