css构造表单

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<html>
	<head>
		<title>css构造表单</title>
		<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
		<style type = "text/css">
			label
			{
				display:block;
			}
		</style>
	</head>
	
	<body>
		<!-- label标签的使用 -->
		<form>
			<label for = "username">用户名:<input type = "text" id = "username" name = "username" /></label>
			性别:<label for = "sex1"><input type = "radio" value = "男" id = "sex1" name = "sex" />男</label>
				 <label for = "sex2"><input type = "radio" value = "女" id = "sex2" name = "sex" />女</label>
			
		</form>
	</body>
</html>  

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<html>
	<head>
		<title>css构造表单</title>
		<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
		<style type = "text/css">
			body
			{
				
			}
			
			input,textarea
			{
				border:3px double black;
			}
			
		</style>
	</head>
	
	<body>
		<form>
			<!-- 给文本框添加漂亮边框 -->
			
			<input type = "text" /> 
			<textarea cols = "20" rows = "9">
			
			</textarea>
		</form>
	</body>
</html>  

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<html>
	<head>
		<title>css构造表单</title>
		<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
		<style type = "text/css">
			body
			{
				
			}
			
			select option.a
			{
				background:green;
			}
			select option.b
			{
				background:red;
			}
			select option.c
			{
				background:blue;
			}
			
		</style>
	</head>
	
	<body>
		<form>
			<!-- 给下拉菜单设置背景 -->
			<select>
				<option class = "a">上海</option>
				<option class = "b">盐城</option>
				<option class = "c">北京</option>
			</select>
			
		</form>
	</body>
</html>  


 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<html>
	<head>
		<title>css构造表单</title>
		<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
		<style type = "text/css">
			body
			{
				
			}
			textarea
			{
				width:300px;
				height:150px;
				
				
				scrollbar-face-color:#333;
				scrollbar-highlight-color:#666;
				scrollbar-shadow-color:red;
				scrollbar-3dlight-color:#999   
				scrollbar-arrow-color:#999;      
				scrollbar-track-color:#999;
				scrollbar-darkshadow-color:#000;
			 

			}
			
		</style>
	</head>
	
	<body>
		<form>
			<!-- 给文本区设置滚动条 -->
			<textarea>
			
			</textarea>
			
		</form>
	</body>
</html>  

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<html>
	<head>
		<title>css构造表单</title>
		<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
		<style type = "text/css">
			fieldset
			{
				margin:20px;
				padding:10px;
				
			}
			legend
			{
				background-color:#ddd;
				padding:5px;
				border-width:1px;
				border-style:solid;
				border-color:#fff #aaa #666 #fff;
			}
			
		</style>
	</head>
	
	<body>
		<form>
			<!-- 表单外边框设置fieldset legend -->
			<fieldset>
				<legend>登录信息</legend>
			</fieldset>
			
		</form>
	</body>
</html>  

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title>css构造表单</title>
		<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
		<style type = "text/css">
			label
			{
				background:yellow;
				<!-- 测试无效,待以后解决 -->
				width:120px; 
				text-align:right;
				float:left;
			} 
			
		</style>
	</head>
	
	<body>
		<!-- 结构化布局表单 -->
		<form id = "regForm">
			<fieldset>
				<legend>登录信息</legend>
				<div class = "dataArea frist"> 
					<label for = "username">用户名:</label><input type = "text" id = "username" class = "input" />
				</div>
				
				<div class = "dataArea">
					<label for = "password">密码:</label><input type = "password" id = "password" class = "input" />
				</div>
				
				<div class = "dataArea">
					<label for = "passwordVerify">确认密码:</label><input type = "password" id = "passwordVerify" class = "input" />
				</div>
			</fieldset>
			
			<fieldset>
				<legend>个人信息</legend>
				<div class = "dataArea frist">
					<label for = "nickname">昵称:</label><input type = "text" id = "nickname" class = "input" />
				</div>
				
				<div class = "dataArea">
					<label for = "email" class = "hint">电子邮件:</label><input type = "text" id = "email" class = "input" />
				</div>
				
				<div class = "subArea">
					<input type = "submit" value = "注册" class = "input" />
					<input type = "button" value = "返回" class = "input" />
				</div>
			</fieldset>
		</form>
	</body>
</html>  


 

 

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值