e vor 10 Monaten
Ursprung
Commit
f42ac866d0
2 geänderte Dateien mit 157 neuen und 0 gelöschten Zeilen
  1. 95 0
      css/4.垂直导航.html
  2. 62 0
      css/5.边框.html

+ 95 - 0
css/4.垂直导航.html

@@ -0,0 +1,95 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>Document</title>
+    <!-- 
+        取消ul的默认样式:list-style: none;
+        取消a的默认样式:text-decoration: none;
+        添加划线:
+        text-decoration
+            line-through 中划线
+            overline 上划线
+            underline 下划线
+     -->
+    <style>
+        ul {
+            list-style: none;
+        }
+        a {
+            text-decoration: none;
+        }
+        #aa {
+            text-decoration: line-through;
+        } 
+        ul li {
+            width: 100px;
+            height: 40px;
+            background-color: aqua;
+            margin-top: 10px;
+            /* 文字在已知宽高的盒子内居中 */
+            text-align: center;
+            /* 行间距 */
+            line-height: 40px;
+        }
+        /* 包含选择器 */
+        ul li a{
+            color: #000;
+            font-size: 16px;
+        }
+        /* 伪类选择器 
+            :hover 划过
+            :first-child 第一个子类
+            :last-child 最后一个子类
+            :nth-child(n) 第n个子类
+                偶数项 even  2n
+                奇数项 odd 2n+1
+        */
+        /* ul li a:hover {
+            color: #ff0;
+        } */
+        ul li:hover {
+            background-color: #f00;
+        }
+        ul li:hover a {
+            color: #ff0;
+        }
+        /* ul li:first-child {
+            background-color: pink;
+        }
+        ul li:first-child a {
+            color: purple;
+        }
+        ul li:last-child {
+            background-color: pink;
+        }
+        ul li:last-child a {
+            color: purple;
+        }
+        ul li:nth-child(3) {
+            background-color: pink;
+        }
+        ul li:nth-child(3) a {
+            color: purple;
+        } */
+        
+        ul li:nth-child(2n+1) {
+            background-color: pink;
+        }
+        ul li:nth-child(2n+1) a {
+            color: purple;
+        }
+    </style>
+</head>
+<body>
+    <div id="aa">aaaa</div>
+    <ul>
+        <li><a href="">大额神卷</a></li>
+        <li><a href="">大额神卷</a></li>
+        <li><a href="">大额神卷</a></li>
+        <li><a href="">大额神卷</a></li>
+        <li><a href="">大额神卷</a></li>
+    </ul>
+</body>
+</html>

+ 62 - 0
css/5.边框.html

@@ -0,0 +1,62 @@
+<!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标签中
+                    在开始标签里 通过class="名字"
+                在style标签里
+                    .名字 {样式...}
+        */
+        .box {
+            width: 200px;
+            height: 200px;
+            /* 边框 
+                复合属性
+                border: width style color;
+                border-width 边框粗细
+                border-style 边框样式
+                    dashed 虚线
+                    solid 实线
+                    dotted 点线
+                    double 双线
+                border-color 边框颜色
+                border-top 边框上
+                border-right 边框右
+                border-bottom 边框下
+                border-left 边框左
+                圆角边框:
+                border-radius
+                50% 圆形
+                border-top-left-radius 左上角圆角
+                border-top-right-radius 右上角圆角
+                border-bottom-left-radius 左下角圆角
+                border-bottom-right-radius 右下角圆角
+            */
+            border: 1px solid #000;
+            border-width: 10px;
+            border-style: solid;
+            border-color: #0f0;
+            border-bottom: 1px solid #f00;
+            border-radius: 50%;
+            /* border-top-left-radius: 20px; */
+        }
+        input {
+            /* 
+                轮廓 outline 所有属性都与border一致
+            */
+            outline: 2px dashed #f00;
+            /* outline: none; */
+            /* border: none; */
+        }
+    </style>
+</head>
+<body>
+    <input type="text">
+    <div class="box"></div>
+</body>
+</html>