bailing hai 2 semanas
pai
achega
74c033a742
Modificáronse 1 ficheiros con 31 adicións e 0 borrados
  1. 31 0
      5.css3/11.盒子水平垂直居中.html

+ 31 - 0
5.css3/11.盒子水平垂直居中.html

@@ -0,0 +1,31 @@
+<!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;
+        }
+        html,body {
+            width: 100%;
+            height: 100%;
+        }
+        #box {
+            width: 200px;
+            height: 200px;
+            background: #f00;
+            position: absolute;
+            top: 50%;
+            left: 50%;
+            margin-top: -100px;
+            margin-left: -100px;
+        }
+    </style>
+</head>
+<body>
+    <div id="box"></div>
+</body>
+</html>