fengchuanyu 9 months ago
parent
commit
1e6a47012e
2 changed files with 22 additions and 2 deletions
  1. 9 0
      2_css/10_盒模型.html
  2. 13 2
      2_css/4_类选择器.html

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

@@ -44,6 +44,12 @@
         .box3 img{
             width: 150px;
         }
+        .box4{
+            width: 100px;
+            height: 100px;
+            background-color: purple;
+            border-radius: 10px;
+        }
     </style>
 </head>
 <body>
@@ -57,5 +63,8 @@
     <div class="box3">
         <img src="./img/img1.jpg" alt="">
     </div>
+    <!-- <hr>  横线-->
+    <hr>
+    <div class="box4"></div>
 </body>
 </html>

+ 13 - 2
2_css/4_类选择器.html

@@ -6,7 +6,7 @@
     <title>Document</title>
     <style>
         /* 伪类选择器 */
-        li:first-child{
+        /* li:first-child{
             color: red;
         }
         li:last-child{
@@ -14,7 +14,18 @@
         }
         li:nth-child(3){
             color: yellow;
-        }
+        } */
+         /* odd 选中奇数标签 */
+        /* li:nth-child(odd){
+            color: red;
+        } */
+         /* even 选中偶数标签 */
+         li:nth-child(even){
+            color: red;
+         }
+         li:hover{
+            color: blue;
+         }
     </style>
 </head>
 <body>