-
Notifications
You must be signed in to change notification settings - Fork 0
/
flex1.css
160 lines (122 loc) · 2.49 KB
/
flex1.css
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
/*
<div class="container">
<header>
<nav>
<li><a href="#"><h1>Header</h1></a></li>
<li><a href="#">Link</a></li>
<li><a href="#">Link</a></li>
</nav>
<button>Button</button>
</header>
<div class="main-and-sidebar-wrapper">
<section class="main">
<h2>Flexbox Layout</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. </p>
<img src="https://unsplash.it/500/550?image=116">
</section>
<aside class="sidebar">
<h3>Sidebar</h3>
</aside>
</div>
<footer>
<h3>Footer</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit.</p>
</footer>
</div>
*/
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
a {
color: inherit;
text-decoration: none;
}
body {
background-color: #e00;
color: #4e4544;
font: italic 16px sans-serif;
}
/* Page Layout */
.container{
max-width: 900px;
background-color: #fff;
margin: 0 auto;
padding: 0 60px;
display: flex;
flex-direction: column;
}
/* Header */
header{
color: #ef5350;
padding: 20px 0;
margin-bottom: 60px;
display: flex;
justify-content: space-between;
}
header nav {
list-style: none;
display: flex;
align-items: baseline;
}
header nav li {
margin-right: 15px;
}
header button {
background-color: #ef5350;
border: none;
padding: 8px 25px;
color: #fff;
cursor: pointer;
text-transform: uppercase;
}
/* Main Section */
.main-and-sidebar-wrapper {
display: flex;
}
.main {
text-align: center;
margin-right: 60px;
flex: 3;
}
.main h2 {
font-size: 32px;
margin-bottom: 55px;
}
.main p {
margin-bottom: 50px;
}
.main img {
width: 100%;
}
/* Sidebar */
.sidebar {
border: 1px solid #a2a2a2;
padding: 20px;
flex: 1;
}
/* Footer */
footer {
color: #ef5350;
text-align: center;
padding: 20px 0;
margin-top: 60px;
}
footer p {
color: #777;
font-size: 12px;
padding: 10px;
}
@media (max-width: 600px) {
.main-and-sidebar-wrapper {
flex-direction: column;
}
.main {
margin-right: 0;
margin-bottom: 60px;
}
}
/*
http://c.h5jun.com/loqa/edit?html,css,output
*/