You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: index.html
+50-75Lines changed: 50 additions & 75 deletions
Original file line number
Diff line number
Diff line change
@@ -170,16 +170,16 @@ <h2>Setting Up Our Work Flow</h2>
170
170
1. The folder will appear in the side bar. Double click on **index.html** in the sidebar to open it. The basic HTML tags for all web pages have been included in this file.
171
171
1. Right click or two finger tap in Sublime and select **Open in Browser**. This will open the HTML file in your *default* browser.
172
172
173
-
What do you see? Your page should look like [exercise 1](project/examples/exercise1.html).
<p>Let's make a change. Replace the “your name here” content, save the file, then refresh your browser.</p>
181
-
182
-
<p>This will be your work flow for the day.</p>
182
+
<p>Let's make a change. Replace the “your name here” content, save the file, then refresh your browser. This will be your work flow for the day.</p>
183
183
184
184
<ol>
185
185
<li>update the code</li>
@@ -310,7 +310,7 @@ <h2>Exercise #1 - Updating your home page (5 mins)</h2>
310
310
311
311
<p>Don’t forget to save and refresh your browser after each change!</p>
312
312
313
-
<p>Your page should now look similar to <ahref="project/examples/exercise1-updated.html">exercise1-updated.html</a></p>
313
+
<p>Your page should now look similar to <ahref="project/examples/exercise1.html">exercise1.html</a></p>
314
314
315
315
<divclass="presenter-notes">
316
316
<p>Use the exercise time to follow along with the current exercise. Since the exercises switch between code-alongs and independent exercises throughout the day, it will be easier to demonstrate the code-alongs if your version is at the same state as the learners.</p>
@@ -888,15 +888,13 @@ <h2>CSS Font Styles</h2>
888
888
<sectionclass="slide">
889
889
<h2>Lunchtime! (Optional Exercise)</h2>
890
890
891
-
<p>Picking fonts is hard. For this project, we'll be using web fonts from Google fonts. Prepare for the post-lunch exercise by picking 2-3 fonts from <ahref="https://www.google.com/fonts">Google Fonts</a> for the body text, header and highlighted text. Here’s a <ahref="/project/final/">the final project</a> for reference.</p>
891
+
<p>Picking fonts is hard. For this project, we'll be using web fonts from Google fonts. Prepare for the post-lunch exercise by picking 2-3 fonts from <ahref="https://www.google.com/fonts">Google Fonts</a> for the body text, header and cursive text. Here’s a <ahref="/project/final/about.html">the final project</a> for reference.</p>
892
892
893
-
894
-
895
893
<p><strong>Need some help choosing?</strong><p>
896
894
<p>Here’s some inspiration: <ahref="http://hellohappy.org/beautiful-web-type/">http://hellohappy.org/beautiful-web-type/</a></p>
897
895
<p>Or try Source Sans Pro, Quicksand, Merriweather or Codystar.</p>
898
896
899
-
<p>If you can't decide which fonts to use, just use the example project fonts: Open Sans (light), Nixie One and Pacifico. The font file links will be provided in the post-lunch exercise.</p>
897
+
<p>If you can't decide which fonts to use, just use the example project fonts: Open Sans (light), Nixie One and Pacifico. The font file links are provided in the post-lunch exercise.</p>
900
898
901
899
<divclass="presenter-notes">
902
900
<p>Aim to get to lunch around 12:30pm. A 45 min lunch is recommended since the afternoon covers a lot & more advanced concepts. Let the learners know this is optional but most people tend to enjoy continuing on a bit of exercises over the break. This will help speed up the next exercise and give them time to personalize their font choices without cutting into class time. If not, they can just use the suggested fonts.</p>
@@ -1125,7 +1123,7 @@ <h2>Box Model Review</h2>
1125
1123
<sectionclass="slide" data-markdown>
1126
1124
##Class Exercise - headings and spacing
1127
1125
1128
-
Now that **styles.css** is linked to all three pages, these next updates will apply to all of them.
1126
+
Now that **styles.css** is linked to all three pages, these next updates will apply to all of the pages.
1129
1127
1130
1128
Add padding to the `header` and `section` so there's an equal amount of space around the content blocks.
<p>In this step, we're focusing on changing the default list styles to a horizontal layout. It will look like this sample below (also found in your examples folder, <ahref="project/examples/exercise5-home.html">exercise 5</a>).</p>
1237
+
<p>In this step, we're focusing on changing the default list styles to a horizontal layout. It will look like this sample below (also found in your examples folder, <ahref="project/examples/exercise5-about.html">exercise 5</a>).</p>
Now it looks like this! Add this anywhere you want some highlighted text!
1324
+
Now it looks like this!
1327
1325
1328
1326

1327
+
1328
+
Add this anywhere you want some highlighted text! Your name is also in the footer. That would be another good place to add this style.
1329
1329
</section>
1330
1330
1331
1331
<sectionclass="slide" data-markdown>
1332
1332
##CSS Float Property
1333
1333
1334
-
Remember, block-style HTML elements like `<p>`, `<div>` and `<section>` automatically start on a new line and stack on top of each other. To get two block elements to align side-by-side, the `float` property can also be used to float elements left or right.
1334
+
Remember, block-style HTML elements like `<p>`, `<div>` and `<section>` automatically start on a new line and stack on top of each other. That's why our content is currently just stacking on top of each other.
1335
1335
1336
-
**However**, we have to break the natural stacking flow when an element is floated. This will cause any element *after* the floated element to try to move up beside it or just not display properly because we've disrupted the natural stacking flow. The parent container will also collapse.
1336
+

1337
1337
1338
-
**Also**, if no width is set, the element will float but the width will automatically be the width of its content.
1338
+
To get two block elements to align side-by-side, we've used `display: inline-block` but the `float` property is often used for creating page layouts.
1339
+
1340
+
**However**, we have to break the natural stacking flow when an element is floated. This will cause any element *after* the floated element to try to move up beside it or just not display properly because we've disrupted the natural stacking flow. The parent container will also collapse.
1339
1341
</section>
1340
1342
1341
1343
<sectionclass="slide centered">
@@ -1345,97 +1347,70 @@ <h2>Huh?</h2>
1345
1347
<pclass="delayed">Not to worry, we can fix it.</p>
1346
1348
</section>
1347
1349
1350
+
<sectionclass="slide" data-markdown>
1351
+
##Floating content
1352
+
1353
+
For the next exercise, we'll use `float` to align the profile image and the text beside each other to make it look like this:
1354
+
1355
+

1356
+
</section>
1348
1357
<sectionclass="slide">
1349
-
<h2>Float, Clear And Clearfix</h2>
1358
+
<h2>Float & Clear</h2>
1350
1359
1351
1360
<p>First we have to break it, then put it back together. We need to “reset” the float to get the rest of the page to go back to normal. There are a couple ways to do it.</p>
1352
1361
1353
-
<p>One of the most confusing CSS concepts is when to use the different techniques, <code>clear: both</code> or the <code>.clearfix</code> class.</p>
1362
+
<p>One of the most confusing CSS concepts is when to use the different techniques.</p>
1354
1363
1355
-
<p>Let’s look at an example: <ahref="http://jsfiddle.net/unjcxses/">http://jsfiddle.net/unjcxses/</a></p>
1364
+
<p>Let’s look at an example: <ahref="http://jsfiddle.net/e1nd3q89/">http://jsfiddle.net/e1nd3q89/</a></p>
1356
1365
1357
-
<p>Rule of thumb: if there’s is an element that <em>follows</em> the floated element, apply <code>clear: both</code> to that element. This will clear the float. If all the elements need to be floated, apply the <code>clearfix</code> to the parent element to force clear the children.</p>
1366
+
<p><strong>Rule of thumb:</strong><br>
1367
+
If there is an element that <em>follows</em> the floated elements, apply <code>clear: both</code> to that element. If all the elements need to be floated, apply the <code>overflow:hidden</code> to the <em>parent element</em> to force clear the children.</p>
1358
1368
1359
-
<p>Want to know more about the clearfix trick and clearing floats? Here you go: <br>
<p>Explain that you can fork or update the jsfiddle to create your own copy and it won't "mess up" the example. It will create a new URL and no account is required.</p>
1365
1375
</div>
1366
1376
</section>
1367
1377
1368
1378
<sectionclass="slide" data-markdown>
1369
-
##Update the CSS file
1379
+
##Class Exercise #6 - Update About page with Floats
1370
1380
1371
-
Before moving onto the next exercise, let's add the [clearfix class](http://nicolasgallagher.com/micro-clearfix-hack/) to our CSS file, after the box model fix.
1372
-
1373
-
```
1374
-
/* apply a natural box layout model to all elements, but allowing components to change */
1375
-
html {
1376
-
box-sizing: border-box;
1377
-
}
1378
-
*, *:before, *:after {
1379
-
box-sizing: inherit;
1380
-
}
1381
+
Add a `profile-img` class to the image tag in your **About** page.
1381
1382
1382
-
/* clears floated child elements */
1383
-
.clearfix:before,
1384
-
.clearfix:after {
1385
-
content: " ";
1386
-
display: table;
1387
-
}
1388
-
.clearfix:after {
1389
-
clear: both;
1390
-
}
1383
+
```xml
1384
+
<img class="profile-img" src="images/profile.jpg" alt="description of image">
1391
1385
```
1392
-
</section>
1393
-
1394
-
<sectionclass="slide" data-markdown>
1395
-
##Class Exercise - classes and floats
1396
-
1397
-
Add a "profile-image" class to the image tag in your **About** page. Then in your css file, add a new comment block at the bottom of the page for your **About** styles, to help organize your style sheet. Then add `float` to get the text to wrap around the image.
1386
+
In **styles.css**, add a new comment block at the bottom of the page for your **About** styles, to help organize your style sheet. Then add `float` to get the text to wrap around the image. Also, add some margin to the right side of the image so there is some space between the image and the text.
1398
1387
1399
1388
```css
1400
1389
/* ABOUT PAGE
1401
1390
-----------------------------------------*/
1402
-
.profile-image {
1391
+
.profile-img {
1403
1392
float: left;
1393
+
margin-right: 20px;
1404
1394
}
1405
1395
```
1406
1396
1407
-
The text floats now, but it's a little squishy. Try setting the image width to be 50% of the page and add some margin on the right to create space.
1408
-
1409
-
.profile-image {
1410
-
float: left;
1411
-
width: 50%;
1412
-
margin-right: 20px;
1413
-
}
1397
+
That looks much better but look what happened to the quote and the footer?! Remember, all elements that come *after* floated elements will want to float too, as long as there is space for them.
1414
1398
1415
-
That looks much better but look what happened to the quote and the footer! All elements that come after floated elements want to float too as long as there is space for them. Let's put the page back to its natural stacking order by *clearing the float*. Put the `clear` on the `blockquote` element because that's where we want things to go back to normal. Let's add a class to it as well, in the HTML.
1399
+
Let's put the page back to its natural stacking order by *clearing the float*. Put the `clear:both` on the `blockquote` element because that's where we want things to go back to normal. While we're here, let's also style the text in the quote and add some spacing.
1416
1400
1417
-
```xml
1418
-
<blockquote class="quote">
1419
-
...
1420
-
</blockquote>
1421
1401
```
1422
-
```
1423
-
.quote {
1424
-
clear: both;
1402
+
blockquote {
1403
+
clear: both; /* clears the float and returns page back to normal stacking order */
1404
+
text-align: center; /* center aligns the text */
1405
+
padding-top: 20px; /* adds space between the blockquote & content before it */
1425
1406
}
1426
-
```
1427
-
1428
-
While we're here, let's update it by center aligning the quote and add some spacing.
1429
-
1430
-
```
1431
-
.quote {
1432
-
clear: both;
1433
-
text-align: center;
1434
-
padding-top: 20px;
1407
+
blockquote p {
1408
+
font-family: "Pacifico", cursive;
1409
+
font-size: 25px;
1435
1410
}
1436
1411
```
1437
1412
1438
-
Your page should now look similar to [exercise6a-about.html](project/examples/exercise6a-about.html).
1413
+
Your page should now look similar to [exercise6-about.html](project/examples/exercise6-about.html).
0 commit comments