We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a229b55 commit ca44047Copy full SHA for ca44047
常用的CSS主流布局案例(1~8)/07_元素水平垂直居中.html
@@ -0,0 +1,36 @@
1
+<!DOCTYPE html>
2
+<html lang="en">
3
+<head>
4
+ <meta charset="UTF-8">
5
+ <title>元素水平垂直居中</title>
6
+ <style>
7
+ body,
8
+ html{
9
+ height: 100%;
10
+ }
11
+ .container{
12
+ border: 1px solid #ddd;
13
14
+
15
+ display: flex;
16
+ flex-direction: column;
17
+ align-items: center;
18
+ justify-content: center;
19
20
+ .container .img{
21
+ width: 100px;
22
+ height: 100px;
23
+ background-color: #ddd;
24
+ border-radius: 100%;
25
+ overflow: hidden;
26
27
+ </style>
28
+</head>
29
+<body>
30
+ <div class="container">
31
+ <div class="img">...</div>
32
+ <div class="title">...</div>
33
+ <div class="info">...</div>
34
+ </div>
35
+</body>
36
+</html>
0 commit comments