-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path负边距等高.html
85 lines (80 loc) · 1.68 KB
/
负边距等高.html
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<style type="text/css">
/*
两列定宽
*/
* {
margin: 0;
padding: 0;
}
#header, #footer {
width: 960px;
height: 30px;
background-color: #e8e8e8;
margin: 0px auto;
}
#container {
width: 960px;
margin: 10px auto;
border: 1px solid red;
overflow: hidden;
}
#container:after {
display: block;
visibility: hidden;
font-size: 0;
line-height: 0;
clear: both;
content: "";
}
.mainBox {
float: left;
width: 70%;
color: #ffffff;
background-color: #333333;
}
.sideBox {
float: right;
width: 28%;
color: #ffffff;
background-color: #999999;
}
.mainBox, .sideBox {
/*padding: 0 5px;*/
color: #ff0000;
padding-bottom: 9999px;
margin-bottom: -9999px;
}
</style>
</head>
<body>
<div id="header">头部信息</div>
<div id="container">
<div class="mainBox">主要内容区域
主要内容区域<br/>
主要内容区域<br/>
主要内容区域<br/>
</div>
<div class="sideBox">侧边栏
主要内容区域<br/>
主要内容区域<br/>
主要内容区域<br/>
主要内容区域<br/>
主要内容区域<br/>
主要内容区域<br/>
主要内容区域<br/>主要内容区域<br/>
主要内容区域<br/>
主要内容区域<br/>主要内容区域<br/>
主要内容区域<br/>
主要内容区域<br/>
主要内容区域<br/>
主要内容区域<br/>主要内容区域<br/>
主要内容区域<br/>
主要内容区域2<br/>
</div>
</div>
<div id="footer">底部信息</div>
</body>
</html>