fengchuanyu 3 weeks ago
parent
commit
edeea6db06
3 changed files with 74 additions and 0 deletions
  1. 25 0
      2_CSS/36_vh_vw.html
  2. BIN
      2_CSS/img/xiaomi/bg.jpg
  3. 49 0
      2_CSS/练习14_小米登录页面.html

+ 25 - 0
2_CSS/36_vh_vw.html

@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>Document</title>
+    <style>
+        body{
+            margin: 0;
+        }
+        .box{
+            /* width: 400px; */
+            /* height: 100%; */
+            background-color: red;
+            /* vh viewport height 视口高度 */
+            /* vi viewport width 视口宽度 */
+            height: 100vh;
+            width: 100vw;
+        }
+    </style>
+</head>
+<body>
+    <div class="box"></div>
+</body>
+</html>

BIN
2_CSS/img/xiaomi/bg.jpg


+ 49 - 0
2_CSS/练习14_小米登录页面.html

@@ -0,0 +1,49 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>Document</title>
+    <style>
+        /* css reset */
+        *{
+            margin: 0;
+            padding: 0;
+        }
+        li{
+            list-style: none;
+        }
+        /* 工具类 */
+        .clearfix::after{
+            content: "";
+            display: block;
+            clear: both;
+        }
+
+        /* 左侧图片区域 start */
+        .img-side{
+            float: left;
+            width: 375px;
+            height: 100vh;
+            background-image: url("./img/xiaomi/bg.jpg");
+            background-size: cover;
+            background-position: center;
+        }
+        /* 左侧图片区域 end */
+        /* 登录内容区域 start */
+        .login-content{
+            float: left;
+            width: calc(100% - 375px);
+            height: 100vh;
+            background-color: #f5f5f5;
+        }
+        /* 登录内容区域 end */
+    </style>
+</head>
+<body>
+    <div class="container clearfix">
+        <div class="img-side"></div>
+        <div class="login-content"></div>
+    </div>
+</body>
+</html>