- html>
- <html lang="zh">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>你好呀,登录吧title>
- <style>
- * {margin: 0;padding: 0;}
-
- html {height: 100%;}
-
- body { height: 100%;}
-
- .container {
- height: 100%;
- background-image: linear-gradient(110deg, #f9bde8, #f670d0);
- }
-
- .login-wrapper {
- background-color: #fbf1f1;
- width: 400px;
- height: 388px;
- border-radius: 50px;
- padding: 0 50px;
- position: relative;
- left: 50%;
- top: 50%;
- transform: translate(-50%, -50%);
- }
-
- .header {
- font-size: 60px;
- font-weight: 900;
- text-align: center;
- line-height: 120px;
- }
-
- .input-item {
- display: block;
- width: 100%;
- margin-bottom: 20px;
- border: 0;
- padding: 10px;
- border-bottom: 1px solid rgb(128, 125, 125);
- font-size: 15px;
- outline: none;
- }
-
- .input-item:placeholder {
- text-transform: uppercase;
- }
-
- .btn {
- text-align: center;
- padding: 10px;
- width: 100%;
- margin-top: 40px;
- background-image: linear-gradient(to right, #a6c1ee, #fbc2eb);
- color: #fff;
- }
-
- .msg {
- text-align: center;
- line-height: 88px;
- }
-
- a {
- text-decoration-line: none;
- color: #abc1ee;
- }
- style>
- head>
- <body>
- <div class="container">
- <div class="login-wrapper">
- <div class="header">登录div>
- <div class="form-wrapper">
- <input type="text" name="输入用户名" placeholder="username" class="input-item">
- <input type="password" name="输入密码" placeholder="password" class="input-item">
- <div class="btn">登录div>
- div>
- <div class="msg">
- 忘记了
- <a href="#">注册a>
- div>
- div>
- div>
- body>
- html>
整体样式:

每个 HTML 文件里开头都有个很重要的东西
,DOCTYPE是document type的简写,它并不是 HTML 标签,也没有结束标签,它是一种标记语言的文档类型声明,即告诉浏览器当前 HTML 是用什么版本编写的。
lang就是language是语言的意思,en也是English的缩写,这句话用来定义页面的语言为英文。可以知道表示语言是中文。
HTML 元素
元素包含了所有的头部标签元素。在 元素中你可以插入脚本(scripts), 样式文件(CSS),及各种meta信息。可以添加在头部区域的元素标签为: