用html+css制作简单好看的登陆注册界面


  • 注重版权,转载请注明原作者和原文链接
  • 作者:Bald programmer

先看看效果图

 login.html代码

<html>
	<head>
		<meta charset="utf-8" />
		<title></title>
		<link rel="stylesheet" href="css/style.css" />
	</head>
	<style>
		body{
			background: url('img/bg.jpg') top left;
			background-size: 100%;
		}
	
	</style>
	<body>
		<div id="div-title">
			<h3>欢迎登陆</h3>
		</div>
		<div id="form-border">
			<form method="post">
				<div id="img-control">
					<img src="img/01.png" id="login-img"/>
				</div>
				<label class="form-label" for="account">账&nbsp;号</label>
				<input id="account" class="form-input" type="text" placeholder="账号" required="required"/><br>
				<label class="form-label" for="password">密&nbsp;码</label>
				<input id="password" class="form-input" type="password" placeholder="密码" required="required"/><br>
				<label id="register" class="form-label" for="password">没有账号?<a href="register.html">点击注册</a></label><br>
				<input id="login" class="form-button" type="submit" value="登陆"/>
			</form>
		</div>
	</body>
</html>

register.html代码

<html>
	<head>
		<meta charset="utf-8" />
		<title></title>
		<link rel="stylesheet" href="css/style.css" />
	</head>
	<style>
		body{
			background: url(img/bg.jpg) top left;
			background-size: 100%;
		}
	</style>
	<body>
		<div id="div-title">
			<h3>欢迎注册</h3>
		</div>
		<div id="form-border">
			<form method="post">
				<div id="img-control">
					<img src="img/01.png" id="register-img"/>
				</div>
				<label class="form-label" for="account">账&nbsp;号</label>
				<input id="account" class="form-input" type="text" placeholder="账号" required="required"/><br>
				<label class="form-label" for="password">密&nbsp;码</label>
				<input id="password" class="form-input" type="password" placeholder="密码" required="required"/><br>
				<label id="register" class="form-label" for="password">已有账号?<a href="login.html">点击登陆</a></label><br>
				<input id="login" class="form-button" type="submit" value="注册"/>
			</form>
		</div>
	</body>
</html>

style.css代码

img {
	width: 150px;
	height: 150px;
}

#login-img{
	margin-left: 30px;
	float: left;
}

#register-img{
	float: right;
	margin-right: 35px;
}

#img-control {
	margin-top: 65px;
}

#form-border {
	background-color: rgba(188, 176, 212, 0.6);
	width: 500px;
	height: 300px;
	position: absolute;
	margin: auto;
	top: 0;
	bottom: 0;
	left: 0;
	right: 0;
}

.form-input {
	width: 200px;
	height: 25px;
	padding-left: 5px;
	border-radius: 5px;
}

.form-label {
	margin-left: 30px;
}

.form-button {
	width: 70px;
	height: 30px;
	margin-top: 10px;
	margin-left: 70px;
	font-size: 18px;
	font-family: "宋体";
}

#div-title {
	text-align: center;
	margin-top: 150px;
}

h3 {
	font-size: 40px;
	font-family: "华文彩云";
}

#password {
	margin-top: 20px;
	margin-bottom: 10px;
}

#register {
	margin-left: 70px;
}

背景图片

  • 142
    点赞
  • 1191
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 45
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

OpenYuan开袁

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值