fengchuanyu 10 months ago
parent
commit
3970d6e339
4 changed files with 122 additions and 0 deletions
  1. 32 0
      2_css/10_盒模型.html
  2. 27 0
      2_css/7_权重值.html
  3. 34 0
      2_css/8_多选择器.html
  4. 29 0
      2_css/9_权重值2.html

+ 32 - 0
2_css/10_盒模型.html

@@ -0,0 +1,32 @@
+<!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: 100px;
+            height: 100px;
+            background-color:red;
+            /* margin:10px; */
+            /* margin-bottom: 10px;
+            margin-top:10px;
+            margin-left: 10px;
+            margin-right: 10px; */
+        /* 外边距    上   右    下   左 */
+            margin:10px 10px 10px 10px;
+            /* 内边距 */
+            padding:10px;
+        }
+        body{
+            /* margin 代表外边距 */
+            margin:0;
+        }
+    </style>
+</head>
+<body>
+    <div class="box1">1</div>
+    <div>hello</div>
+</body>
+</html>

+ 27 - 0
2_css/7_权重值.html

@@ -0,0 +1,27 @@
+<!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>
+        #id1{
+            color: blue;
+        }
+        .b{
+            color: yellow;
+        }
+        .a{
+            color: red;
+        }
+        div{
+            color: purple;
+        }
+    </style>
+</head>
+<body>
+    <div class="a" id="id1">hello</div>
+    <div class="a b">world</div>
+    <div>你好</div>
+</body>
+</html>

+ 34 - 0
2_css/8_多选择器.html

@@ -0,0 +1,34 @@
+<!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>
+        /* .c{
+            color: red;
+        } */
+        /* .a .b .c{
+            color: red;
+        } */
+        .a .c{
+            color: red;
+        }
+        .c{
+            color: blue;
+        }
+    </style>
+</head>
+<body>
+    <div class="a">
+        hello
+        <div class="b">
+            world
+            <div class="c">
+                你好
+            </div>
+        </div>
+    </div>
+    <div class="c">世界</div>
+</body>
+</html>

+ 29 - 0
2_css/9_权重值2.html

@@ -0,0 +1,29 @@
+<!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>
+        /* .a{
+            color: red !important;
+            font-size: 40px !important;
+        } */
+        #id1{
+            color: blue;
+            font-size: 80px;
+        }
+        /* span{
+            color: blue;
+        }
+        *{
+            color: red;
+        } */
+    </style>
+</head>
+<body>
+    <div style="color: aquamarine;" class="a" id="id1">hello</div>
+    <div class="b a">world</div>
+    <span>你好</span>
+</body>
+</html>