HTML5学习记录(二)

HTML5 Input 类型

输入类型

HTML5 拥有多个新的表单输入类型。这些新特性提供了更好的输入控制和验证。

  • email
  • url
  • number
  • range
  • Date pickers (date, month, week, time, datetime, datetime-local)
  • search
  • color
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>HTML5--表单测试</title>
<style>
	input{
		margin-bottom:20px;}
</style>
</head>

<body>
	<form action="" method="get">
    E-mail: <input type="email" name="user_email" /><br />
    Url: <input type="url" name="user_url" /><br />
    Number: <input type="number" name="points" min="1" max="10" /><br/>
    Range: <input type="range" name="points" min="1" max="10" /><br/>
    Date: <input type="date" name="user_date" /><br/>
    Search: <input type="search" name="user_search"/><br/>
    Color: <input type="color" name="user_color"/><br/>
    <input type="submit"/>
    </form>
</body>
</html>

演示结果:
在这里插入图片描述

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章