代码如下:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>登录表单</title>
<style>
body{
background-image: url(static/登录界面背景.jpg);
background-size: 50%;
background-repeat: no-repeat;
background-position: center;
}
.login{
padding-top: 120px;
}
</style>
</head>
<body>
<form action="" width="500" height="400">
<div class="login" align="center">
<div>
<label for="username">用户名</label>
<input type="text" id="username" value="" placeholder="至少8位" autofocus required>
</div>
<div>
<label for="pwd">密码:</label>
<input type="password" name="pwd" value="" placeholder="数字+字母" required>
</div>
<div>
<label for="my-email">邮箱:</label>
<input type="email" name="my-email" value="" placeholder="abc@email.com" required>
</div>
<p></p>
<div>
<button>提交</button>
</div>
</div>
</form>
</body>
</html>
运行代码后实际效果如图:
相关推荐
© 2020 asciim码
人生就是一场修行