html5 初探2 表单

一个简单的表单

 

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>test regist</title>
<link href="../css/add.css" rel="stylesheet" type="text/css">
</head>
<body>
	<div class='content'>
	    <header><h1>个人信息录入</h1></header>
		<form action="">
			<fieldset>
				<legend>基本信息</legend>
				<ol>
					<li><label for='name'>姓名:</label><input id='name' type="text" placeholder="name" required autofocus></li>
					<li><label for='age'>年龄:</label><input id='age' type="number" placeholder="age" required>	</li>	
					<li>
					   <ol>
						   <li>
						   		<label for='sex-1'>男</label><input name='sex' id='sex-1' type="radio">	
						   </li>
						   <li>
						   		<label for='sex-2'>女</label><input name='sex' id='sex-2' type="radio">	
						   </li>
					   </ol>
						
						
					</li>
				</ol>
			</fieldset>
			<fieldset>
				<legend>地址</legend>
				<ol>
					<li><label for='country'>国家:</label>
						<select>	
							<option value='1'>中国</option>
							<option value='2'>日本</option>
						</select>
					</li>
					<li><label for='city'>城市:</label><input id='city' type="text" placeholder="city" required>	</li>	
				</ol>
				
			</fieldset>
			<fieldset>
				<button type=submit>注册</button>
			</fieldset>
		</form>
		
		<footer>by xufei 2013/04</footer>
	</div>
	
</body>
</html>

 

 

css样式,里面有些 css3的东西

@CHARSET "UTF-8";

body {
	background: #ffffff;
	color: #111111;
}
header {
	text-align: center;
}
footer {
	text-align: center;
	font-size: 14px;
	margin-top: 10px;
}
select {
	height:25px;
	width:156px;
}

input {
	-moz-border-radius: 3px;
	-webkit-border-radius: 3px; /* 圆角 */
	border-radius: 3px;
	height:20px;
	box-shadow: 0 0 3px #aaa; /* 阴影 */
}

.content {
	width : 800px;
	height: 100%;
	border: 1px solid;
	margin-right: auto;
	margin-left: auto;
	padding-top: 10px;
	padding-left: 5px;
	padding-right: 5px;
}

form {
	background: #9cbc2c;
	border-radius: 5px;
	padding: 20px;
	width: 400px;
	margin-left: auto;
	margin-right: auto;
}
/* 表单分组  */
form fieldset {
	-moz-border-radius: 5px;
	-webkit-border-radius: 5px;
	margin-bottom: 10px;
}
/* 表单分组 最后一个  */
form fieldset:last-of-type {
	margin-bottom: 0;
	border:none;
	text-align:center;		
}
/* 表单分组 的标题  他的位置根据fieldset的 text-align:center决定*/
form legend {
	color: #384313;
	font-size: 16px;
	font-weight: bold;
	padding-bottom: 5px;
	text-shadow: 0 1px 1px #c0d576;
}

form label {
	float: left;
	width: 110px;
}
form fieldset fieldset label {
	background:none no-repeat left 50%;
	line-height: 20px;
	padding: 0 0 0 30px;
	width: auto;
}
form fieldset label:hover {
	cursor: pointer;
}

form ol li {
	background: #b9cf6a;
	background: rgba(255,255,255,.3);
	border-color: #e3ebc3;
	border-color: rgba(255,255,255,.6);
	border-style: solid;
	border-width: 2px;
	-moz-border-radius: 5px;
	-webkit-border-radius: 5px;
	border-radius: 5px;
	line-height: 30px;
	list-style: none;
	padding: 5px 10px;
	margin-bottom: 2px;
	float: left;

}

form ol ol {
	padding-left: 5px
}
form ol ol li {
	background: none;
	border: none;
	float: left;
}

form ol ol li label{
	background:none no-repeat left 50%;
	line-height: 20px;
	
	width: auto;
}

/* 提交按钮 */
form button {
	width:100px;
	height:30px;
	font-weight: bold;
    color: #2D2D2D;
    font-size: 14px;
    text-shadow: 0px 1px 1px #fff;
    text-align: center;
    margin-left: auto;
    margin-right: auto;
    border: 1px solid rgb(160,160,160);
    -webkit-border-radius: 5px;
    -moz-border-radius: 5px;
    background: -webkit-gradient(linear, left top, left bottom, from(rgb(253,253,253)), to(rgb(190,190,190))); /* 渐变 在webkit核心浏览器下(Safari4+, Chrome) */
    background: -moz-linear-gradient(top, rgb(253,253,253), rgb(190,190,190)); /*  */
    filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#FDFDFD,endColorstr=#BEBEBE); /* IE */
    cursor: pointer;
    text-decoration: none;
}
/* 鼠标放到按钮上时,按钮的样式 */
form button:hover {
	 background: rgb(190,190,190 );
	 text-decoration: none;
     color: #000;
}

 

 

以上代码只在 google的Chrome下测试过

 

整个页面看起来跟用VB做出的效果很像

 

 说明:

    1,fieldset 元素可将表单内的相关元素分组。跟VB的一样,很好用的标签

    2,渐进效果让按钮看起来更立体,就像有个图片背景似的

    3,button:hover;鼠标放到按钮上时,改变按钮的样式

    4,html5的表单input还自带一些页面验证的功能,例如:type是number时自动验证是不是数字,还有一个必须输入的属性required

 

关于验证的部分,下次一个一个实验

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
城市应急指挥系统是智慧城市建设的重要组成部分,旨在提高城市对突发事件的预防和处置能力。系统背景源于自然灾害和事故灾难频发,如汶川地震和日本大地震等,这些事件造成了巨大的人员伤亡和财产损失。随着城市化进程的加快,应急信息化建设面临信息资源分散、管理标准不统一等问题,需要通过统筹管理和技术创新来解决。 系统的设计思路是通过先进的技术手段,如物联网、射频识别、卫星定位等,构建一个具有强大信息感知和通信能力的网络和平台。这将促进不同部门和层次之间的信息共享、交流和整合,提高城市资源的利用效率,满足城市对各种信息的获取和使用需求。在“十二五”期间,应急信息化工作将依托这些技术,实现动态监控、风险管理、预警以及统一指挥调度。 应急指挥系统的建设目标是实现快速有效的应对各种突发事件,保障人民生命财产安全,减少社会危害和经济损失。系统将包括预测预警、模拟演练、辅助决策、态势分析等功能,以及应急值守、预案管理、GIS应用等基本应用。此外,还包括支撑平台的建设,如接警中心、视频会议、统一通信等基础设施。 系统的实施将涉及到应急网络建设、应急指挥、视频监控、卫星通信等多个方面。通过高度集成的系统,建立统一的信息接收和处理平台,实现多渠道接入和融合指挥调度。此外,还包括应急指挥中心基础平台建设、固定和移动应急指挥通信系统建设,以及应急队伍建设,确保能够迅速响应并有效处置各类突发事件。 项目的意义在于,它不仅是提升灾害监测预报水平和预警能力的重要科技支撑,也是实现预防和减轻重大灾害和事故损失的关键。通过实施城市应急指挥系统,可以加强社会管理和公共服务,构建和谐社会,为打造平安城市提供坚实的基础。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值