fengchuanyu 2 veckor sedan
förälder
incheckning
0eb80be413
2 ändrade filer med 106 tillägg och 0 borttagningar
  1. 43 0
      2-CSS/17_其他单位.html
  2. 63 0
      2-CSS/练习10_伪类.html

+ 43 - 0
2-CSS/17_其他单位.html

@@ -0,0 +1,43 @@
+<!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>
+        .box1{
+            width: 400px;
+            height: 400px;
+            border:1px solid black
+
+        }
+        .box2{
+            width: 100%;
+            height: 200px;
+            background-color: red;
+            /* padding:20px; */
+        }
+        body{
+            margin: 0;
+        }
+        .box3{
+            /* width: 100%; */
+            background-color: red;
+            /* vh\vw 会把整个视口分为100份 */
+            /*width: 100vw; /* 视口宽度  viewport width*/
+            height: 100vh; /* 视口高度 viewport height*/
+            margin-left: 100px;
+            /* width: calc(100vw - 100px); */
+            width: calc(100% - 100px); 
+            
+        }
+    </style>
+</head>
+<body>
+    <!-- <div class="box1">
+        <div class="box2">hello</div>
+    </div> -->
+
+    <div class="box3"></div>
+</body>
+</html>

+ 63 - 0
2-CSS/练习10_伪类.html

@@ -0,0 +1,63 @@
+<!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>
+        .content ul li:hover{
+            background-color: #307df7;
+            cursor: pointer;
+        }
+
+        .header{
+            text-align: center;
+            border-bottom: 1px solid blue;
+        }
+        .content{
+            width: 400px;
+            margin: 0 auto;
+            /* background-color: red; */
+        }
+        .content li{
+            width: 300px;
+            background-color: #aaa;
+            list-style: none;
+            margin-top: 20px;
+            /* height: 50px;
+            line-height: 50px;
+            padding-left: 20px; */
+            padding: 20px;
+            border-radius: 10px;
+            color: white;
+        }
+        .content li:nth-child(even){
+            background-color: #666;
+        }
+        .content li:first-child{
+            background-color: #307df7;
+        }
+        .content li:last-child:hover::after{
+            content: "这是最后一个列表";
+        }
+    </style>
+</head>
+<body>
+    <div class="container">
+        <div class="header">
+            <h1>我的简单网页</h1>
+        </div>
+        <div class="content">
+            <p>以下是一些列表项:</p>
+            <ul>
+                <li>项目一</li>
+                <li>项目二</li>
+                <li>项目三</li>
+                <li>项目四</li>
+                <li>项目五</li>
+                
+            </ul>
+        </div>
+    </div>
+</body>
+</html>