作业2 登录 注册 后台管理 商城页面

 

输入:

登录页面:

<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title>Insert title here</title>
</head>
<body>
	<div style = "width:980px;height:400px;margin:auto;margin-top:100px;">
		<div style = "width:40%;height:100%;inline-height:100%;float:left;text-align:center">
			<img alt="" src="1.jpg" style = "display:inline-block;width:100%;height:100%;">
		</div>
		<div style = "width:59%;height:100%;float:right;position:relative;">
			<div style = "position:absolute;left:10%;width:70%;height:70%;">
				<div style = "margin:10%;width:80%;height:10%;">
					<div style = "width:25%;height:100%;float:left;text-align:right;">
						<label for = "username" style = "color:red">*</label>
						<label for = "username" style = "font-size:20px;font-weight:bold;">用户名:</label>
					</div>
					<div style ="height:25px;width:200px;float:left;position:relative;">
						<input type="text" style = "height:25px;width:170px;padding-right:30px">
							<span style="position:absolute;right:5px;top:7px;background-image:url('i_name.jpg');height:16px;width:16px;display:inline-block;background-repeat:no-repeat;">	
						</span>
					</div>					
				</div>
				
				<div style = "margin:10%;width:80%;height:10%;">
					<div style = "width:25%;height:100%;float:left;text-align:right;">
						<label for = "username" style = "color:red">*</label>
						<label for = "username" style = "font-size:20px;font-weight:bold;">密码:</label>
					</div>
					<div style ="height:25px;width:200px;float:left;position:relative;">
						<input type="text" style = "height:25px;width:170px;padding-right:30px">
							<span style="position:absolute;right:5px;top:7px;background-image:url('i_pwd.jpg');height:21px;width:14px;display:inline-block;background-repeat:no-repeat;">	
						</span>
					</div>					
				</div>
				
				<div style = "margin:10%;width:80%;height:10%;">
					<div style = "width:25%;height:100%;float:left;text-align:right;">
						<label for = "username" style = "color:red">*</label>
						<label for = "username" style = "font-size:20px;font-weight:bold;">验证码:</label>
					</div>
					<div style ="height:25px;width:200px;float:left;position:relative;">
						<input type="text" style = "height:25px;width:170px;padding-right:30px">
							<span style="position:absolute;right:5px;top:5px;background-image:url('i_phone.jpg');height:21px;width:14px;display:inline-block;background-repeat:no-repeat;">	
						</span>
					</div>					
				</div>
				
				<div style = "margin:10%;width:80%;height:10%;margin-left:120px;">
					<input type = "checkbox">
					<label>自动登录</label>
					<label>&nbsp;&nbsp;&nbsp;&nbsp;忘记密码</label>
				</div>
				
				<div style = "width:50%;height:15%;margin-left:120px;margin-top:40px;">
					<input onclick = "window.open('https://blog.csdn.net/zhuisaozhang1292')" type = "button" value = "登录" style = " background-color: red;width:100%;height:100%; border:0"  >																
				</div>
				
			</div>
			<a href = "https://blog.csdn.net/zhuisaozhang1292">
				<div style = "position:absolute;right:0;bottom:0;width:120px;height:40px;line-height:40px;background:green;text-align:center;">
					 免费注册&gt;&gt; 
				</div>
			</a>
		</div>
		
	</div>
</body>
</html>

输出效果:

 

注册页面

输入:

<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title>Insert title here</title>
</head>
<body>
	<div style = "width:980px;height:400px;margin:auto;margin-top:100px;">
	
	 <div class = "pg-header" style = "width:980;height:100px;">
	 	
		<div style = "width:100px;height:20px;inline-height:50px;float:left;text-align:center ;">收藏本站</div>
		<div style = "width:100px;height:20px;inline-height:50px;float:right;text-align:center ;">登录</div>
		<div style = "width:100px;height:20px;inline-height:50px;float:right;text-align:center ;">免费注册</div>
		<div style = "width:100px;height:20px;inline-height:50px;float:right;text-align:center ;">我的订单</div>
		<div style = "width:120px;height:20px;inline-height:50px;float:right;text-align:center ;">VIP会员俱乐部</div>
		<div style = "width:100px;height:20px;inline-height:50px;float:right;text-align:center ;">客户服务</div>
	</div>
	
	 <div class = "pg-content" style = "width:980;height:800px;">		
		<div style = "width:200px;height:100px;">
			<img alt="" src="1.jpg" style = "width:200px;height:100px;">
		</div>
		
		<div style = "width:500px;height:600px;margin-top:50px;">
			<div>
				<label style = "font-size:30px;margin-left:50px;top:100px;">注册新用户</label>
			</div>
			
			<div style = "width:200px;height:28px;float:left;text-align:right;margin-top:20px;">
				<label for = "username" style = "color:red">*</label>
				<label for = "username" style = "font-size:20px;font-weight:bold;">用户名:</label>
			</div>			
			<div style ="width:200px;height:30px;float:left;position:relative;margin-top:20px;">
				<input id = "username" type="text" style = "height:25px;width:170px;padding-right:30px">
					<span style="position:absolute;right:5px;top:7px;background-image:url('i_name.jpg');height:16px;width:16px;display:inline-block;background-repeat:no-repeat;">	
				</span>
			</div>		
			
			<div style = "width:200px;height:28px;float:left;text-align:right;margin-top:20px;">
				<label for = "userphone" style = "color:red">*</label>
				<label for = "userphone" style = "font-size:20px;font-weight:bold;">手机名:</label>
			</div>			
			<div style ="width:200px;height:30px;float:left;position:relative;margin-top:20px;">
				<input id = "userphone" type="text" style = "height:25px;width:170px;padding-right:30px">
					<span style="position:absolute;right:5px;top:7px;background-image:url('i_phone.jpg');height:21px;width:14px;display:inline-block;background-repeat:no-repeat;">	
				</span>
			</div>		
			<div style = "width:200px;height:28px;float:left;text-align:right;margin-top:20px;">
				<label for = "userpwd" style = "color:red">*</label>
				<label for = "userpwd" style = "font-size:20px;font-weight:bold;">登录密码:</label>
			</div>			
			<div style ="width:200px;height:30px;float:left;position:relative;margin-top:20px;">
				<input id = "userpwd" type="password" style = "height:25px;width:170px;padding-right:30px">
					<span style="position:absolute;right:5px;top:7px;background-image:url('i_pwd.jpg');height:16px;width:16px;display:inline-block;background-repeat:no-repeat;">	
				</span>
			</div>		
			<div style = "width:200px;height:28px;float:left;text-align:right;margin-top:20px;">
				<label for = "userpwd_again" style = "color:red">*</label>
				<label for = "userpwd_again" style = "font-size:20px;font-weight:bold;">确认密码:</label>
			</div>			
			<div style ="width:200px;height:30px;float:left;position:relative;margin-top:20px;">
				<input id = "userpwd_again" type="password" style = "height:25px;width:170px;padding-right:30px">
					<span style="position:absolute;right:5px;top:7px;background-image:url('i_pwd.jpg');height:16px;width:16px;display:inline-block;background-repeat:no-repeat;">	
				</span>
			</div>		
			<div style = "width:200px;height:28px;float:left;text-align:right;margin-top:20px;">
				<label for = "verify_code" style = "color:red">*</label>
				<label for = "verify_code" style = "font-size:20px;font-weight:bold;">验证码:</label>
			</div>			
			<div style ="width:200px;height:30px;float:left;position:relative;margin-top:20px;">
				<input id = "verify_code" type="text" style = "height:25px;width:170px;padding-right:30px">
					<span style="position:absolute;right:5px;top:7px;background-image:url('i_phone.jpg');height:21px;width:14px;display:inline-block;background-repeat:no-repeat;">	
				</span>
			</div>
			
			<div style = "margin-left:120px;margin-top:20px;float:left;">
					<input type = "checkbox">
					<label>我已阅读并同意</label>
					<a href = "https://blog.csdn.net/zhuisaozhang1292">《用户注册协议》</a>
			</div>
			
			<a href = "https://blog.csdn.net/zhuisaozhang1292">
				<div style = "width:200px;height:40px; margin-left:120px;margin-top:20px;float:left;border:0;text-align:center;line-height:40px;background-color:red">
					<label style = "font-size:20px;font-weight:bold;">自动登录</label>
				</div>	
			</a>
						
				
		</div>
		
	</div>
	 
	</div>
</body>
</html>

样式

 

输入:

<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title>Insert title here</title>
	<style>
        .hide{
            display: none;
        }
        .item .header{
            height: 35px;
            background-color: #2459a2;
            color: white;
            line-height: 35px;
        }
    </style>
</head>
<body>
		<div class = "pg-header" style = "width:10980;height:30px;line-height:30px;background-color:pink;position:fixed;top:0;right: 0;left:0;">
		 	
			<div style = "width:100px;height:20px;inline-height:50px;float:left;text-align:center ;">收藏本站</div>
			<div style = "width:100px;height:20px;inline-height:50px;float:right;text-align:center ;">登录</div>
			<div style = "width:100px;height:20px;inline-height:50px;float:right;text-align:center ;">免费注册</div>
			<div style = "width:100px;height:20px;inline-height:50px;float:right;text-align:center ;">我的订单</div>
			<div style = "width:120px;height:20px;inline-height:50px;float:right;text-align:center ;">VIP会员俱乐部</div>
			<div style = "width:100px;height:20px;inline-height:50px;float:right;text-align:center ;">客户服务</div>
		</div>
		
		<div>
			<div style="width: 300px;float:left;margin-top:22px;">
	 
		        <div class="item">
		            <div id='i1' class="header" onclick="ChangeMenu('i1');">菜单1</div>
		            <div class="content">
		                <div>内容1</div>
		                <div>内容1</div>
		                <div>内容1</div>
		            </div>
		        </div>
		        <div class="item">
		            <div id='i2' class="header" onclick="ChangeMenu('i2');">菜单2</div>
		            <div class="content hide">
		                <div>内容2</div>
		                <div>内容2</div>
		                <div>内容2</div>
		            </div>
		        </div>
		        <div class="item">
		            <div id='i3' class="header" onclick="ChangeMenu('i3');">菜单3</div>
		            <div class="content hide">
		                <div>内容3</div>
		                <div>内容3</div>
		                <div>内容3</div>
		            </div>
		        </div>
		        <div class="item">
		            <div id='i4' class="header" onclick="ChangeMenu('i4');">菜单4</div>
		            <div class="content hide">
		                <div>内容4</div>
		                <div>内容4</div>
		                <div>内容4</div>
		            </div>
		        </div>
	    	</div>
	    	<div style="height:1500px;width: 1000px;background-color:green;float:left;margin-top:22px;">
	    	123
	    	</div>
		</div>
		<div onclick="GoTop();" style = 'width:70px;height:50px;line-height:50px;background-color: black;color: white;position:fixed;bottom:20px;right: 20px'>
		返回顶部
		</div>
	<script>
        function ChangeMenu(nid){
            var current_header = document.getElementById(nid);
 
            var item_list = current_header.parentElement.parentElement.children;
 
            for(var i=0;i<item_list.length;i++){
                var current_item = item_list[i];
                current_item.children[1].classList.add('hide');
            }
 
            current_header.nextElementSibling.classList.remove('hide');
        }
        function GoTop(){
			document.body.scrollTop = 0;
		}
    </script>
</body>
</html>

输出:

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值