fengchuanyu 2 долоо хоног өмнө
parent
commit
9e5178412b

+ 13 - 0
2-CSS/23_引入css.html

@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>Document</title>
+    <!-- link 引入外部文件 rel表明引入的文件类型 stylesheet样式表   href引入外部文件的地址 -->
+    <link rel="stylesheet" href="./index.css">
+</head>
+<body>
+    <div class="box"></div>
+</body>
+</html>

+ 5 - 0
2-CSS/index.css

@@ -0,0 +1,5 @@
+.box{
+    width: 100px;
+    height: 100px;  
+    background-color: red;
+}

+ 37 - 13
2-CSS/练习13_小米官网.html

@@ -5,6 +5,7 @@
     <meta charset="UTF-8">
     <meta charset="UTF-8">
     <meta name="viewport" content="width=device-width, initial-scale=1.0">
     <meta name="viewport" content="width=device-width, initial-scale=1.0">
     <title>Document</title>
     <title>Document</title>
+    <link rel="stylesheet" href="https://at.alicdn.com/t/c/font_4974983_5en83d04csd.css">
     <style>
     <style>
         /* css reset 样式重置 把浏览器自带的标签样式去掉 */
         /* css reset 样式重置 把浏览器自带的标签样式去掉 */
         * {
         * {
@@ -26,30 +27,30 @@
 
 
         /* 字体库 */
         /* 字体库 */
         /* 声明字体 */
         /* 声明字体 */
-        @font-face {
+        /* @font-face { */
             /* 字体名称 声明*/
             /* 字体名称 声明*/
-            font-family: "iconfont";
+            /* font-family: "iconfont"; */
             /* 引入字体 */
             /* 引入字体 */
-            src: url('https://at.alicdn.com/t/c/font_4974983_ok50xp288v.woff2?t=1752545241384') format('woff2'),
+            /* src: url('https://at.alicdn.com/t/c/font_4974983_ok50xp288v.woff2?t=1752545241384') format('woff2'),
                 url('https://at.alicdn.com/t/c/font_4974983_ok50xp288v.woff?t=1752545241384') format('woff'),
                 url('https://at.alicdn.com/t/c/font_4974983_ok50xp288v.woff?t=1752545241384') format('woff'),
                 url('https://at.alicdn.com/t/c/font_4974983_ok50xp288v.ttf?t=1752545241384') format('truetype');
                 url('https://at.alicdn.com/t/c/font_4974983_ok50xp288v.ttf?t=1752545241384') format('truetype');
-        }
+        } */
 
 
         /* 字体图标 使用iconfont这个就是开始使用自定义字体图标*/
         /* 字体图标 使用iconfont这个就是开始使用自定义字体图标*/
-        .iconfont {
+        /* .iconfont { */
             /* 字体图标 引用 */
             /* 字体图标 引用 */
-            font-family: "iconfont" !important;
-            font-size: 16px;
+            /* font-family: "iconfont" !important;
+            font-size: 16px; */
             /* 字体图标 正常 */
             /* 字体图标 正常 */
-            font-style:normal;
+            /* font-style:normal; */
             /* 字体图标 平滑 */
             /* 字体图标 平滑 */
-            -webkit-font-smoothing: antialiased;
+            /* -webkit-font-smoothing: antialiased;
             -moz-osx-font-smoothing: grayscale;
             -moz-osx-font-smoothing: grayscale;
-        }
+        } */
         /* 购物车图标 */
         /* 购物车图标 */
-        .icon-gouwuchekong:before {
+        /* .icon-gouwuchekong:before {
             content: "\e600";
             content: "\e600";
-        }
+        } */
 
 
 
 
         /* 头部导航 开始 */
         /* 头部导航 开始 */
@@ -100,8 +101,28 @@
             line-height: 40px;
             line-height: 40px;
             margin-left: 20px;
             margin-left: 20px;
             padding: 0 15px;
             padding: 0 15px;
+            height: 40px;
+            position: relative;
+        }
+        .header-nav .car .car-content{
+            position: absolute;
+            right: 0;
+            top: 40px;
+            width: 320px;
+            background-color: #fff;
+            box-shadow: 0 2px 10px rgba(0, 0, 0, .15);
+            padding: 20px 0;
+            text-align: center;
+            display: none;
+        }
+        .header-nav .car:hover{
+            background-color: #fff;
+            color: #ff6700;
         }
         }
 
 
+        .header-nav .car:hover .car-content{
+            display: block;
+        }
         .download-btn {
         .download-btn {
             position: relative;
             position: relative;
         }
         }
@@ -141,7 +162,6 @@
             border-right: 10px solid transparent;
             border-right: 10px solid transparent;
             border-bottom: 10px solid white;
             border-bottom: 10px solid white;
         }
         }
-
         /* 头部导航 结束 */
         /* 头部导航 结束 */
     </style>
     </style>
 </head>
 </head>
@@ -195,11 +215,15 @@
                     </ul>
                     </ul>
                     <div class="car">
                     <div class="car">
                         <span> <i class="iconfont icon-gouwuchekong"></i> 购物车(0)</span>
                         <span> <i class="iconfont icon-gouwuchekong"></i> 购物车(0)</span>
+                        <div class="car-content">
+                            <p>购物车中还没有商品,赶紧选购吧!</p>
+                        </div>
                     </div>
                     </div>
                 </div>
                 </div>
             </div>
             </div>
         </div>
         </div>
         <!-- 头部导航 开始 -->
         <!-- 头部导航 开始 -->
+         <i class="iconfont icon-search"></i>
     </div>
     </div>
 </body>
 </body>