发表于: 2018-12-26 20:04:36
1 800
今天完成的事情:
了解了input,并且学会了如何限制样式和用maxlength控制数量
了解了transform
完成了任务四,效果图如下:
代码如下:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="task4.css">
<title>任务四</title>
</head>
<body>
<div class="nav">
<span class="registered">注册</span>
<span class="column"><p>登陆</p></span>
<span class="shut-down">关闭</span>
</div>
<form>
<div class = "input-form">
<span class= "icon"><img src = "iphone.png" alt = "登录" height = "21px" /> </span>
<input type = "text" placeholder = "请输入手机号" maxlength="11" onkeyup="this.value=this.value.replace(/[^0-9-]+/,'');" />
</div>
<div class = "input-form1">
<span class= "icon"><img src = "locked 2.png" alt = "密码" height = "21px" /> </span>
<input type = "password" placeholder = "请输入密码">
</div>
</form>
<div class="subnav">
<button class="loginba">登 陆</button>
</div>
<div>
<p class="msg"><a href="http://www.jnshu.com/home" class="footer">忘记密码?</a></p>
</div>
</body>
</html>
css代码如下:
*{
padding: 0;
margin: 0;
}
body{
background-color: #eff0f4;
}
.nav{
height: 50px;
background-color: #5fc0cd;
position: relative;
}
span{
color: white;
}
p{
display: inline-block;
color: white;
font-size: 18px;
}
.registered{
float: right;
margin-right: 15px;
margin-top: 14px;
}
.column{
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
}
.shut-down{
float: left;
margin-left: 15px;
margin-top: 14px;
}
.input-form {
margin-top: 8px;
width: 100%;
display: inline-block;
background-color: #ffffff;
height: 50px;
}
.input-form1 {
margin-top: 7px;
width: 100%;
display: inline-block;
background-color: #ffffff;
height: 50px;
}
.input-form input {
width: 50%;
margin-left: 75px;
margin-top: 17px;
border: 0;
font-size: 16px;
outline: aliceblue;
}
.input-form1 input {
width: 50%;
margin-left: 75px;
margin-top: 17px;
border: 0;
font-size: 16px;
outline: aliceblue;
}
.input-form .icon {
margin: 15px 10px 5px 21px;
padding-right: 23px;
border-right: 1px solid #dcdcdc;
display: inline-block;
position: absolute;
}
.input-form1 .icon {
margin: 15px 10px 5px 21px;
padding-right: 23px;
border-right: 1px solid #dcdcdc;
display: inline-block;
position: absolute;
}
input::-webkit-input-placeholder {
color: #e1e5e7;
}
.subnav{
height: 50px;
background-color: #5fc0cd;
margin-top: 35px;
position: relative;
}
.loginba{
color: white;
background-color: #5fc0cd;
border: 0;
font-size: 18px;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%,-50%);
outline:medium;
cursor: pointer;
}
.msg{
float: right;
margin-top: 13px;
margin-right: 17px;
font-size: 16px;
}
.footer{
text-decoration:none;
color: #83ccd7;
}
明天计划的事情:
接触任务五
了解弹性盒子
巩固定位
遇到的问题:
无法实现垂直居中,记过师兄的讲解最终解决了问题,还需要反复熟悉
收获:
同今天完成的事情
评论