zheng 19 小時之前
父節點
當前提交
4b3673ef30
共有 6 個文件被更改,包括 42 次插入0 次删除
  1. 13 0
      11.复习/6.获取屏幕的宽高.html
  2. 29 0
      11.复习/7.距离.html
  3. 二進制
      11.复习/img/1.png
  4. 二進制
      11.复习/img/2.png
  5. 二進制
      11.复习/img/3.png
  6. 二進制
      11.复习/img/4.png

+ 13 - 0
11.复习/6.获取屏幕的宽高.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>
+</head>
+<body>
+    <script>
+        var screenWidth = document.body.clientWidth || document.documentElement.clientWidth;
+    </script>
+</body>
+</html>

+ 29 - 0
11.复习/7.距离.html

@@ -0,0 +1,29 @@
+<!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: 300px;
+            margin-top: 150px;
+            margin-left: 400px;
+            background: aqua;
+        }
+    </style>
+</head>
+<body>
+    <div id="box"></div>
+    <script>
+        let box = document.getElementById("box");
+        // console.log(box.clientWidth);
+        // console.log(box.clientHeight);
+        console.log(box.offsetWidth)
+        console.log(box.offsetHeight)
+        console.log(box.offsetLeft)
+        console.log(box.offsetTop)
+    </script>
+</body>
+</html>

二進制
11.复习/img/1.png


二進制
11.复习/img/2.png


二進制
11.复习/img/3.png


二進制
11.复习/img/4.png