Lyrics


< More and better />


双飞翼布局

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<title>已知宽高元素水平垂直居中</title>
<style>
*{
margin:0;
padding: 0;
}
.left{
float: left;
width:100px;
background: red;
margin-left: -100%;
}
.center{
float: left;
width:100%;
background: blue;
}
.inner{
margin:0 100px;
}
.right{
float: left;
width:100px;
background: green;
margin-left: -100px;
}
</style>
</head>
<body>
<div class="main">
<div class="center">
<div class="inner">center</div>
</div>
<div class="left">left</div>
<div class="right">right</div>
</div>
</body>
</html>