-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcss-layout.css
More file actions
93 lines (78 loc) · 1.1 KB
/
css-layout.css
File metadata and controls
93 lines (78 loc) · 1.1 KB
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
86
87
88
89
90
91
92
93
/*不同方式实现左侧宽度固定,右侧自适应布局*/
/*
<div class="container">
<div class="left"></div>
<div class="right"></div>
</div>
*/
/*1.flex*/
.container {
display: flex;
}
.left{
width: 200px;
height:800px;
border:1px solid red
}
.right{
height:800px;
flex:1;
border:1px solid blue
}
/*2.grid*/
.container {
display: grid;
grid-template-columns: 200px auto;
}
.left{
height:800px;
border:1px solid red
}
.right{
height:800px;
border:1px solid blue
}
/*3.浮动*/
.container {
}
.left{
float: left;
width:200px;
height:800px;
border:1px solid red
}
.right{
margin-left: 200px;
height:800px;
border:1px solid blue
}
/*4.table*/
.container {
display: table;
width: 100%;
}
.left {
display: table-cell;
width: 200px;
height: 800px;
border: 1px solid red;
}
.right {
display: table-cell;
height: 800px;
border: 1px solid blue;
}
/*5.absolute*/
.container {
}
.left {
position: absolute;
width: 200px;
height: 800px;
border: 1px solid red;
}
.right {
margin-left: 200px;
height: 800px;
border: 1px solid blue;
}