Skip to content

Commit 34c1ec8

Browse files
committed
Completed Building a Simple Float Layout
1 parent 09ed4d2 commit 34c1ec8

File tree

2 files changed

+55
-20
lines changed

2 files changed

+55
-20
lines changed

myWork/04-CSS-Layouts/index.html

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,42 +111,52 @@ <h3>Why should you learn HTML?</h3>
111111
</article>
112112

113113
<aside class="related-aside">
114-
<h4>Related posts</h4>
114+
<h4 class="related-posts-title">Related posts</h4>
115115
<ul class="related">
116116
<li>
117117
<img
118+
class="related-article-image"
118119
src="images/related-1.jpg"
119120
alt="Learn Web Development"
120121
width="75"
121122
height="75"
122123
/>
123-
<a href="#">How to Learn Web Development</a>
124+
125+
<a href="#" class="related-article-title"
126+
>How to Learn Web Development</a
127+
>
124128
<p class="related-author">By Jonas Schmedtmann</p>
125129
</li>
126130
<li>
127131
<img
132+
class="related-article-image"
128133
src="images/related-2.jpg"
129134
alt="Lightning Strike"
130135
width="75"
131136
height="75"
132137
/>
133-
<a href="#">The Unknown Powers of CSS</a>
138+
<a href="#" class="related-article-title"
139+
>The Unknown Powers of CSS</a
140+
>
134141
<p class="related-author">By Jim Dillon</p>
135142
</li>
136143
<li>
137144
<img
145+
class="related-article-image"
138146
src="images/related-3.jpg"
139147
alt="Code on Screen"
140148
width="75"
141149
height="75"
142150
/>
143-
<a href="#">Why JavaScript is Awesome</a>
151+
<a href="#" class="related-article-title"
152+
>Why JavaScript is Awesome</a
153+
>
144154
<p class="related-author">By Matilda</p>
145155
</li>
146156
</ul>
147157
</aside>
148158

149-
<footer>
159+
<footer class="article-footer">
150160
<p class="copyright">Copyright &copy; 2027 by The Code Magazine.</p>
151161
</footer>
152162
</div>

myWork/04-CSS-Layouts/style.css

Lines changed: 40 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,10 @@
44
}
55

66
.container {
7-
width: 700px;
7+
width: 1200px;
88
margin: 0 auto;
99
}
1010

11-
.article-content {
12-
margin: 0 15px;
13-
}
14-
1511
body {
1612
color: #444444;
1713
font-family: sans-serif;
@@ -132,8 +128,7 @@ a:active {
132128

133129
.article-image {
134130
margin-bottom: 5px;
135-
width: 500px;
136-
height: auto;
131+
width: 100%;
137132
}
138133

139134
strong {
@@ -162,7 +157,7 @@ strong {
162157
cursor: pointer;
163158

164159
position: absolute;
165-
bottom: 0;
160+
bottom: 20px;
166161
right: 0;
167162
}
168163

@@ -180,15 +175,15 @@ strong {
180175
display: inline-block;
181176
position: absolute;
182177
padding: 3px 7px;
183-
top: -5px;
184-
right: -5px;
178+
top: 5px;
179+
right: 0;
185180
}
186181

187182
/* Floats */
188183

189184
.author-image {
190185
float: left;
191-
margin-right: 5px;
186+
margin-right: 8px;
192187
}
193188

194189
.author {
@@ -197,10 +192,6 @@ strong {
197192
margin-bottom: 15px;
198193
}
199194

200-
.article-image {
201-
float: left;
202-
}
203-
204195
.title-text {
205196
float: left;
206197
}
@@ -214,3 +205,37 @@ strong {
214205
content: "";
215206
display: block;
216207
}
208+
209+
.product-article {
210+
width: 825px;
211+
float: left;
212+
}
213+
214+
.related-aside {
215+
width: 300px;
216+
float: right;
217+
}
218+
219+
.article-footer {
220+
clear: both;
221+
}
222+
223+
.navigation-bar {
224+
margin-top: 15px;
225+
}
226+
227+
.navigation-bar a {
228+
margin-right: 20px;
229+
}
230+
231+
.related-article-title {
232+
display: inline-block;
233+
}
234+
235+
.related li {
236+
margin-bottom: 10px;
237+
}
238+
239+
.related-posts-title {
240+
margin-bottom: 10px;
241+
}

0 commit comments

Comments
 (0)