志在指尖
用双手敲打未来

用表格制做购物车列表和表单完成用户注册页

<!DOCTYPEhtml>
<htmllang=”en”>
<head>
<metacharset=”UTF-8″>
<metaname=”viewport”content=”width=device-width,initial-scale=1.0″>
<title>表单</title>
<style>
fieldset{
border:rgb(216,159,2)1pxsolid;
padding:15px15px;
width:50%;
margin:0auto;
margin-bottom:30px;
}
legend{
padding:5px;
background-color:tomato;
color:white;
}
fieldsetdiv{
margin-bottom:10px;
}
textarea{
width:300px;
}
.btn{
width:50%;
margin:20pxauto;
text-align:center;
}
button{
width:150px;
height:35px;
line-height:35px;
color:white;
background-color:tomato;
border:none;
cursor:pointer;
}
button:hover{
background-color:teal;
}
</style>
</head>
<body>
<formmethod=”POST”action=””>
<div>
<fieldset>
<legend>基本信息</legend>
<div>
<labelfor=”username”>帐号:</label>
<inputname=”username”id=”username”type=”text”placeholder=”6-12位字符”requiredautofocus>
</div>
<div>
<labelfor=”email”>邮箱:</label>
<inputname=”email”id=”email”type=”email”placeholder=”demo@demo.com”required>
</div>
<div>
<labelfor=”pwd1″>密码:</label>
<inputname=”pwd1″id=”pwd1″type=”password”placeholder=”不少于6位且必须子母加数字”required>
</div>
<div>
<labelfor=”pwd2″>确认密码:</label>
<inputname=”pwd2″id=”pwd2″type=”password”required>
</div>
</fieldset>
<fieldset>
<legend>扩展信息</legend>
<div>
<label>生日:
<inputname=”birthda”type=”date”required></label>
<!–label中不写for,可以将表单元素放在label中,也可实现点击Label文字,表单获取焦点–>
</div>
<div>
<labelfor=”secret”>性别:</label>
<inputtype=”checkbox”name=”gender”id=”male”value=”male”>
<labelfor=”male”>男</label>
<inputtype=”radio”name=”gender”id=”female”value=”female”>
<labelfor=”female”>女</label>
<inputtype=”radio”name=”gender”id=”secret”value=”secret”>
<labelfor=”secret”>保密</label>
</div>
<div>
<labelfor=”game”>爱好:</label>
<inputtype=”checkbox”name=”hobby[]”id=”sleep”value=”sleep”>
<labelfor=”sleep”>睡觉</label>
<inputtype=”checkbox”name=”hobby[]”id=”book”value=”book”>
<labelfor=”book”>看书</label>
<inputtype=”checkbox”name=”hobby[]”id=”game”value=”game”checked>
<labelfor=”game”>游戏</label>
</div>
<!–选项列表–>
<div>
<labelfor=”brand”>手机品牌:</label>
<inputtype=”search”list=”phone”id=”brand”name=”brand”>
<!–上面的id和name不可与list的值一致–>
<datalistid=”phone”>
<!–id要和上面的List绑定,是一致的–>
<optionvalue=”mi”label=”小米”></option>
<optionvalue=”apple”label=”苹果”></option>
<optionvalue=”huawei”label=”华为”></option>
</datalist>
</div>
</fieldset>
<fieldset>
<legend>其它信息</legend>
<div><labelfor=”pic”>上传头像:</label><inputtype=”file”name=”pic”id=”pic”
accept=”image/jpg,image/png,image/gif”></div>
<div><labelfor=”resume”>简历:</label><textareaname=”resume”rows=”5″placeholder=”不超过100字”
id=”resume”></textarea></div>
</fieldset>
<!–隐藏域–>
<inputtype=”hidden”name=”userid”id=”userid”value=”111″>
<divclass=”btn”><button>提交</button></div>
</form>
</body>
</html>

未经允许不得转载:IT技术网站 » 用表格制做购物车列表和表单完成用户注册页
分享到: 更多 (0)

评论 抢沙发

评论前必须登录!

 

志在指尖 用双手敲打未来

登录/注册IT技术大全

热门IT技术

C#基础入门   SQL server数据库   系统SEO学习教程   WordPress小技巧   WordPress插件   脚本与源码下载