e před 4 týdny
rodič
revize
27642ef158
1 změnil soubory, kde provedl 54 přidání a 0 odebrání
  1. 54 0
      2.css/8.浮动.html

+ 54 - 0
2.css/8.浮动.html

@@ -0,0 +1,54 @@
+<!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: 800px;
+            height: 800px;
+            margin: 0 auto;
+            border: 3px solid #000;
+        }
+        #part1 {
+            width: 200px;
+            height: 200px;
+            /* display: inline-block; */
+            float: left;
+            background-color: #f00;
+        }
+        #part2 {
+            width: 230px;
+            height: 230px;
+            /* margin-top: 10px; */
+            /* display: inline-block; */
+            float: left;
+            background-color: #ff0;
+        }
+        #part3 {
+            width: 200px;
+            height: 200px;
+            /* float: left; */
+            background-color: #00f;
+        }
+        /* 
+        当想让元素在一行展示时
+            使用浮动
+                float:left/right/none
+                使元素脱离文档流 不占位
+
+            排版:
+                文档排版
+                浮动
+        */
+    </style>
+</head>
+<body>
+    <div id="box">
+        <div id="part1"></div>
+        <div id="part2"></div>
+        <div id="part3"></div>
+    </div>
+</body>
+</html>