e 10 сар өмнө
parent
commit
b43f27fae7
1 өөрчлөгдсөн 74 нэмэгдсэн , 0 устгасан
  1. 74 0
      移动端/5.案例5.html

+ 74 - 0
移动端/5.案例5.html

@@ -0,0 +1,74 @@
+<!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>
+        header, nav, footer {
+            width: 100%;
+            height: 80px;
+            font-size: 24px;
+            font-weight: bold;
+            text-align: center;
+            line-height: 80px;
+            background: #ccc;
+            margin-top: 10px;
+        }
+        .part1 {
+            width: 100%;
+            height: 150px;
+            background: #f00;
+        }
+        .part2 {
+            width: 100%;
+            height: 150px;
+            background: #00f;
+        }
+        @media screen and (max-width: 758px) {
+            .picture {
+                width: 100%;
+                height: 300px;
+                background: url("./images/3.jpg") no-repeat center center;
+            }
+        }
+        @media screen and (min-width:768px) and (max-width: 1000px) {
+            .picture {
+                width: 100%;
+                height: 500px;
+                background: url("./images/1.jpg") no-repeat center center;
+                margin-top: 10px;
+            }
+            .main {
+                display: flex;
+            }
+            .part1 {
+                flex: 3;
+            }
+            .part2 {
+                flex: 2;
+                margin-left: 15px;
+            }
+        }
+        @media screen and (min-width: 1001px) {
+            .picture {
+                width: 100%;
+                height: 500px;
+                background: url("./images/2.jpg") no-repeat center center;
+            }
+        }
+    </style>
+</head>
+<body>
+    <div>
+        <header>页眉</header>
+        <nav>导航</nav>
+        <div class="picture"></div>
+        <div class="main">
+            <div class="part1"></div>
+            <div class="part2"></div>
+        </div>
+        <footer>页尾</footer>
+    </div>
+</body>
+</html>