h5表单基本属性

页面,ie,火狐,Google对每个属性的支持不同,部分时间属性无法显示

<!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;
	}

效果



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值