h5表单基本属性
2016-10-28 10:05
363 查看
页面,ie,火狐,Google对每个属性的支持不同,部分时间属性无法显示
css类用来控制前台布局
效果
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta content="widtd=device-widtd,initial-scale=1.0,maximum-scale=1.0,user-scalable=no" name="viewport"> <meta content="yes" name="apple-mobile-web-app-capable"> <meta content="black" name="apple-mobile-web-app-status-bar-style"> <meta content="yes" name="apple-mobile-web-app-capable"> <meta content="black" name="apple-mobile-web-app-status-bar-style"> <meta content="telephone=no" name="format-detection"> <meta content="email=no" name="format-detection"> <link rel="stylesheet" href="h5.css" type="text/css"> <title>H5表单</title> </head> <body> <h3 align="center">HTML5新表单</h3> <form autocomplete="on" name="form" action="" method="get" > <table> <tr> <td style="background-color:#CCC"><strong>说明</strong></td> <td style="background-color:#CCC"><strong>控件效果</strong></td> </tr> <tr> <td class="tdOne">颜色选择器</td> <td><input type="color" name="favcolor" class="wid"/></td> </tr> <tr> <td class="tdOne">时间日期</td> <td><input type="datetime" class="wid"></td> </tr> <tr> <td class="tdOne">日期</td> <td><input type="date" name="time" class="wid"/></td> </tr> <tr> <td class="tdOne">时间</td> <td><input type="time" class="wid" name="time"></td> </tr> <tr> <td class="tdOne">电子邮件</td> <!--required属性用了验证type="email"邮箱格式是否正确,其余类型验证也用request --> <td><input type="email" class="wid" name="email" placeholder="请输输入邮箱,如,1508396210@qq.com" required="true"></td> </tr> <tr> <td class="tdOne">网址</td> <td><input type="url" class="wid" name="url"></td> </tr> <tr> <td class="tdOne">数字</td> <td><input type="number" class="wid" name"number"></td> </tr> <tr> <td class="tdOne">滑动条</td> <td><input type="range" name="range" class="wid"></td> </tr> <tr> <td class="tdOne">搜索文本框</td> <td><input type="search" class="wid" name="search"></td> </tr> <tr> <td class="tdOne">电话号码</td> <td><input type="tel" class="wid" required="true"></td> </tr> <tr> <td class="tdOne">文本输入提供备选</td> <td><input type="text" name="text1" class="wid"></td> </tr> <tr> <td colspan="2"><input type="submit" value="提交"></td> <td></td> </tr> </table> </form> </body> </html>
css类用来控制前台布局
table{ border:1px solid #000; border-collapse: collapse; margin-top: 10px; width: 100%;} td{ text-overflow: ellipsis; white-space: nowrap; overflow: hidden; border: 1px solid #000; text-align: center; height:40px; } .tdOne{ font-size:14px; width:30%; } .wid{ width:80%; height:80%; text-align:center; } input[type="submit"]{ width:100px; height:80%; background-color:#CCC; }
效果
相关文章推荐
- H5新表单属性
- H5新增表单属性
- HTML5表单的基本属性和使用方法
- 文件上传的基本操作之表单属性enctype的设置
- h5表单新增元素与属性form、formaction、formmethod、formenctype、formtarget、autofocus、required、labels
- ajax提交form表单,H5的required属性没起作用
- H5新增的表单属性
- H5语义化标签表单控件及属性
- H5表单中placeholder属性的字体颜色问题
- h5表单新增元素与属性control、placeholder、list、AutoComplete、pattern、SelectionDirection、indeterminate、
- 繁星H5之旅-HTML5表单新增元素与属性
- H5中form表单中新增属性
- 疯狂H5讲义笔记 - 表单相关元素和属性
- h5 form表单新增属性
- H5表单属性(持续添加)
- H5表单和一些新属性
- 表单标签基本属性
- H5利用pattern属性和oninvalid属性验证表单
- 繁星H5之旅-HTML5表单新增元素与属性
- 基本属性和表单