-
Notifications
You must be signed in to change notification settings - Fork 9
/
02_flexible.html
173 lines (173 loc) · 3.99 KB
/
02_flexible.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, user-scalable=0">
<title>自适应布局</title>
<style>
*{
margin: 0;
padding: 0;
}
html{
font-size: 10px;
}
body{
font-size: 1.2rem;
}
.wrap{
max-width: 640px;
margin: 0 auto;
}
.header{
position: relative;
min-width: 320px;
height: 44px;
line-height: 44px;
border-bottom: 1px solid #e0e0e0;
background-color: #fff;
text-align: center;
}
.header a{
position: absolute;
left: 0;
top: 0;
width: 44px;
height: 44px;
background: url(images/back.png) center no-repeat;
background-size: 13px 24px;
}
.header h1{
display: inline-block;
font-size: 17px;
font-weight: normal;
color: #000;
vertical-align: top;
}
.banner{
position: relative;
}
.banner:after{
content: '';
display: block;
padding-top: 53.06666667%;
}
.banner img{
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
}
.list{
margin: 3.125% auto;
border-top: 1px solid #e0e0e0;
}
.list .item{
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
padding: 3.125%;
overflow: hidden;
border-bottom: 1px solid #e0e0e0;
color: #333;
text-decoration: none;
}
.list .item .pic{
position: relative;
width: 20%;
margin-right: 10px;
}
.list .item .pic:after{
content: '';
display: block;
padding-top: 100%;
}
.list .item .pic img{
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
}
.list .item .box{
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-box-flex: 1;
-webkit-flex: 1;
-ms-flex: 1;
flex: 1;
-ms-flex-direction:column;
-webkit-box-orient:vertical;
box-orient:vertical;
-webkit-flex-direction:column;
flex-direction:column;
overflow: hidden;
}
.list .item .box h3{
height: 20px;
line-height: 20px;
overflow: hidden;
white-space: nowrap;
text-overflow:ellipsis;
font-size: 14px;
font-weight: normal;
color: #333;
}
.list .item .box p{
height: 40px;
line-height: 20px;
margin: auto 0;
overflow: hidden;
color: #666;
}
.footer{
line-height: 40px;
text-align: center;
color: #666;
}
</style>
</head>
<body>
<div class="header">
<a href="javascript:;" class="back"></a>
<h1>固定宽度布局</h1>
</div>
<div class="banner wrap">
<img src="http://d8.yihaodianimg.com/N10/M02/13/34/ChEi21eIVAyAZ_47AAFUdFaDNDs58500.jpg" alt="">
</div>
<div class="list wrap">
<a href="javascript:;" class="item">
<div class="pic">
<img src="http://d9.yihaodianimg.com/N08/M0A/3F/4C/ChEi1VZL-gCADeJ4AADrKGqqr2g55100_120x120.jpg" alt="">
</div>
<div class="box">
<h3>商品标题商品标题商品标题</h3>
<p>商品描述商品描述商品描述商品描述商品描述商品描述商品描述</p>
</div>
</a>
<a href="javascript:;" class="item">
<div class="pic">
<img src="http://d9.yihaodianimg.com/N08/M0A/3F/4C/ChEi1VZL-gCADeJ4AADrKGqqr2g55100_120x120.jpg" alt="">
</div>
<div class="box">
<h3>商品标题商品标题商品标题商品标题商品标题商品标题商品标题商品标题商品标题</h3>
<p>商品描述商品描述商品描述商品描述商品描述商品描述商品描述</p>
</div>
</a>
<a href="javascript:;" class="item">
<div class="pic">
<img src="http://d9.yihaodianimg.com/N08/M0A/3F/4C/ChEi1VZL-gCADeJ4AADrKGqqr2g55100_120x120.jpg" alt="">
</div>
<div class="box">
<h3>商品标题商品标题商品标题</h3>
<p>商品描述商品描述商品描述商品描述商品描述商品描述商品描述</p>
</div>
</a>
</div>
<div class="footer">《七天精通移动端网页布局》版权所有</div>
</body>
</html>