内联式可以不用加type=text?css吗?
但是我下面的这样也是可以运行的欸,用的还比较多
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<style type="text/css">
*{
margin: 0;
padding: 0;
text-decoration: none;
box-sizing: border-box;
}
body{
min-height: 100vh;
background-color: skyblue;
}
.login-box{
width: 360px;
background: #fff;
height: 580px;
padding: 80px 40px;
border-radius: 10px;
position: absolute;
left: 50%;
top:50%;
transform: translate(-50%,-50%);
}
.login-box h1{
text-align: center;
margin-bottom: 60px;
}
.txtb{
position: relative;
margin: 30px 0;
}
.txtb input{
width: 280px;
height: 50px;
border: 1px solid #bbb;
border-radius: 5%;
}
.txtb select{
width: 200px;
height: 25px;
border: 1px solid #bbb;
border-radius: 5%;
}
.logbtn{
display: block;
width: 100%;
height: 50px;
border: none;
font-size: 20px;
background-size: 200%;
background-color: #ff6300;
outline: none;
cursor: pointer;
transition: .5s;
}
.logbtn:hover{
background-position: right;
}
.bottom-text{
margin-top: 60px;
text-align: center;
font-size: 13px;
}
</style>
<body>
<form action="LoginServlet" method="post" class="login-box" >
<h1>宿舍管理系统</h1>
<div class="txtb">
<input type="text" name="username"><br/>
</div>
<div class="txtb">
<input type="password" name="password"><br/>
</div>
<div class="txtb">
<p>你选择登录的身份是?</p>
<select>
<option>学生</option>
<option>老师</option>
<option>宿舍管理员</option>
</select>
</div>
<input type="submit" class="logbtn" value="提交">
<div class="bottom-text">
</div>
</form>
</body>
</html>