e 1 rok temu
rodzic
commit
ad0727b086

+ 2 - 0
html5/12.本地存储2.html

@@ -31,7 +31,9 @@
         // 获取cookie
         function getCookie(name) {
             var cookie = document.cookie;
+            console.log(cookie,'cook')
             var arr = cookie.split(";");
+            console.log(arr,'arr')
             for(var i=0;i<arr.length;i++) {
                 var temp = arr[i].split("=");
                 if(temp[0].trim() == name) {

+ 18 - 0
移动端/1.移动端.html

@@ -0,0 +1,18 @@
+<!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>
+        #box {
+            width: 200px;
+            height: 200px;
+            background: #00f;
+        }
+    </style>
+</head>
+<body>
+    <div id="box"></div>
+</body>
+</html>

+ 46 - 0
移动端/2.移动端单位.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>
+    <style>
+        * {
+            margin: 0;
+            padding: 0;
+        }
+        body {
+            /* font-size: 10px; */
+        }
+        #box {
+            width: 4rem;
+            height: 4rem;
+            background: #f00;
+            font-size: 20px;
+        }
+        #box1 {
+            width: calc(50vw - 100px);
+            height: 50vh;
+            /* width: 3em; */
+            /* height: 3em; */
+            background: #00f;
+        }
+
+        /* 
+            单位:
+                px 像素
+                %  百分比
+                rem 根元素大小 16px
+                em  根据父元素的大小
+                vh、vw 相对于整个视口 设备
+                calc()
+        */
+    </style>
+</head>
+<body>
+    <div id="box">
+        <div id="box1"></div>
+    </div>
+    <script src="./rem.js"></script>
+</body>
+</html>