更换前
longin.html
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <title>login</title> <link href="/css/style.css" type="text/css" rel="stylesheet"> <script src="/static/js/change.js"></script> </head> <body> <div class="control"> <div class="item"> <div class="active">登录</div> </div> <div class="content"> <div style="display: block;"> <form action="/user/login" method="post"> <p>账号</p> <input type="text" placeholder="请输入用户名" name="username"/> <p>密码</p> <input type="password" placeholder="请输入密码" name="password"/> <br/> <input type="submit" value="登录"/> </form> <p>没有账号,<a href="/user/register" target="top">去注册</a></p> </div> </div> </div> </body> </html>
style.css
*{
margin: 0;
padding: 0;
}
body{
background: #f3f3f3;
}
.control{
width: 340px;
background: white;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
border-radius: 5px;
}
.item{
width: 340px;
height: 60px;
background: #eeeeee;
}
.item div{
width: 340px;
height: 60px;
display: inline-block;
color: black;
font-size: 18px;
text-align: center;
line-height: 60px;
cursor: pointer;
}
.content{
width: 100%;
}
.content div{
margin: 20px 30px;
display: none;
text-align: left;
}
p{
color: #4a4a4a;
margin-top: 30px;
margin-bottom: 6px;
font-size: 15px;
}
.content input[type="text"], .content input[type="password"]{
width: 100%;
height: 40px;
border-radius: 3px;
border: 1px solid #adadad;
padding: 0 10px;
box-sizing: border-box;
}
.content input[type="submit"]{
margin-top: 40px;
width: 100%;
height: 40px;
border-radius: 5px;
color: white;
border: 1px solid #adadad;
background: cyan;
cursor: pointer;
letter-spacing: 4px;
margin-bottom: 40px;
}
.active{
background: white;
}
.item div:hover{
background: #f6f6f6;
}
如果我们要更改登录框后面的背景颜色
#65cea7
更换后
字体颜色代码:
白色#FFFFFF | 红色#FF0000 | 绿色#00FF00 | 蓝色#0000F | 青色#00FFFF |
黄色#FFFF00 | 黑色#000000 | 棕色#A67D3D | 金色#CD7F32 | 灰色#C0C0C0 |
青黄色#93DB70 | 牡丹红#FF00FF | 海蓝#70DB93 | 蓝紫色#9F5F9F | 亮金色#D9D919 |
巧克力色#5C3317 | 珊瑚红#FF7F00 | 黄铜色#B5A642 | 深绿#2F4F2F | 青铜色#8C7853 |
紫蓝色#42426F | 深绿松石色#7093DB | 深棕#5C4033 | 淡灰色#545454 | 浅蓝色#C0D9D9 |
森林绿#238E23 | 深紫色#871F78 | 深橄榄绿#4F4F2F | 浅灰色#A8A8A8 | 桔黄色#E47833 |
海蓝色#32CD99 | 橙色#FF7F00 | 淡紫色#DB70DB | 浅绿色#8FBC8F | 粉红色#BC8F8F |
银色#E6E8FA | 天蓝#3299CC | 黄绿色#99CC32 | 海军蓝#23238E | 紫罗兰色#4F2F4F |