fengchuanyu 8 月之前
父节点
当前提交
d74d5d3f72
共有 7 个文件被更改,包括 125 次插入0 次删除
  1. 46 0
      8_移动端/6_媒体查询.html
  2. 3 0
      8_移动端/css/a.css
  3. 3 0
      8_移动端/css/b.css
  4. 二进制
      8_移动端/img/1.jpg
  5. 二进制
      8_移动端/img/2.jpg
  6. 二进制
      8_移动端/img/3.jpg
  7. 73 0
      8_移动端/练习题1_两列布局.html

+ 46 - 0
8_移动端/6_媒体查询.html

@@ -0,0 +1,46 @@
+<!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" media="screen and (max-width: 600px)" href="./css/a.css">
+    <link rel="stylesheet" media="screen and (max-width: 900px) and (min-width: 800px)" href="./css/b.css">
+    <style>
+        .box{
+            width: 200px;
+            height: 200px;
+            background-color: red;
+        }
+        @media screen and (max-width:500px) {
+            .box{
+                background-color: blue;
+            }
+        }
+        @media screen and (max-width:600px) and (min-width:500px) {
+            .box{
+                background-color: yellow;
+            }
+        }
+
+        /* 竖屏 */
+        @media (orientation:portrait){
+            .box{
+                font-size: 50px;
+                color: aqua;
+            }
+        }
+        /* 横屏 */
+        @media (orientation:landscape){
+            .box{
+                font-size: 60px;
+                color: blueviolet;
+            }
+        }
+    </style>
+</head>
+<body>
+    <a href="https://www.runoob.com/cssref/css3-pr-mediaquery.html">文档</a>
+    <div class="box">hello</div>
+</body>
+</html>

+ 3 - 0
8_移动端/css/a.css

@@ -0,0 +1,3 @@
+.box{
+    border:5px solid blue;
+}

+ 3 - 0
8_移动端/css/b.css

@@ -0,0 +1,3 @@
+.box{
+    border:10px dashed green;
+}

二进制
8_移动端/img/1.jpg


二进制
8_移动端/img/2.jpg


二进制
8_移动端/img/3.jpg


+ 73 - 0
8_移动端/练习题1_两列布局.html

@@ -0,0 +1,73 @@
+<!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{
+            margin: 0;
+        }
+        .left{
+            width: 400px;
+            background-color: blue;
+        }
+        .left,.right{
+            height: 500px;
+        }
+        .right{
+            background-color: red;
+        }
+
+        /* 方法一flex */
+        /* .container{
+            display: flex;
+        }
+        
+        .right{
+            flex-grow: 1;
+        } */
+
+        /* 方法二定位 */
+        /* .left{
+            position: absolute;
+            top:0;
+            left: 0;
+        }
+        .right{
+            margin-left: 400px;
+        } */
+
+        /* 方法三 calc */
+        /* .left{
+            float: left;
+        }
+        .right{
+            float: right;
+            width: calc( 100% - 400px);
+        } */
+
+        /* 方法四 maring*/
+        .container{
+            margin-left: 400px;
+        }
+        .right{
+            width: 100%;
+            float: left;
+            margin-left: -400px;
+        }
+        .left{
+            float: left;
+            position: relative;
+            left: -400px;
+        }
+    </style>
+</head>
+<body>
+    <div class="container">
+        <div class="left">left</div>
+        <div class="right">right</div>
+    </div>
+</body>
+</html>