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
<p>Void tags don’t format content — instead, they embed objects in the page. These tags <strong>do not</strong> come in pairs since they do not wrap content like the other tags we’ve been using so far. They <em>are</em> the content!</p>
33
+
34
+
<p>The syntax is slightly different in the latest version of HTML so you may see it written in two ways. Prior to HTML5, these tags were self-closed with a forward slash immediately before the right angled bracket (<code>/></code>). In HTML5, void tags are not required to self close.</p>
35
+
36
+
<p>A common void tag is the <code><br /></code> or <code><br></code> tag used to create a line break.</p>
Just like the different languages that we speak and write, HTML has to follow proper "grammar" rules. This is referred to as **syntax**. Tags are used to describe the content, **not** what they look like. That's what CSS is for.
209
209
210
-
The are many different HTML tags used to create structure and add semantics (meaning) to the content. For example, any content between the `<html></html>` tag tells the browser that it is HTML code and content between the `<title></title>` tag describes the web page title.
210
+
The are many different HTML tags used to create structure and add semantics (meaning) to the content.
211
211
212
212
```xml
213
213
<p>I'm a paragraph because I'm wrapped by paragraph tags.</p>
@@ -292,10 +292,10 @@ <h2>Nesting HTML tags</h2>
292
292
<sectionclass="slide" data-markdown>
293
293
##Exercise #1 - Updating your home page (10 mins)
294
294
295
-
1. In your text editor (Sublime Text), update your name.
295
+
1. In the Sublime Text editor, update your name in the `h1` if you haven't already.
296
296
1. Add your tag line under your name using the appropriate heading tag.
297
297
1. Change the content in the `<title></title>` tag. Where do you see this change?
298
-
1. Add a copyright message. Use a paragraph (`<p>`) tag *inside* of the `<footer>` tag.
298
+
1. Add a copyright message using a paragraph (`<p>`) tag *inside* of the `<footer>` tag.
299
299
300
300
**Bonus:** Try using an HTML code for the copyright *symbol*. Here are some resources:
301
301
http://character-code.com/ascii-table.php
@@ -321,7 +321,7 @@ <h2>Nesting HTML tags</h2>
321
321
<sectionclass="slide" data-markdown>
322
322
##Navigation menu & Lists
323
323
324
-
There are two kinds of lists in HTML: ordered (`ol`) for numbered lists & undordered (`ul`) for lists with bullets. *Content must be included only within the list item* (`li`).
324
+
There are two kinds of lists in HTML: ordered (`ol`) for numbered lists & unordered (`ul`) for lists with bullets. Content must be included **only within the list item** (`li`).
325
325
326
326
```xml
327
327
<ul>
@@ -342,7 +342,7 @@ <h2>Nesting HTML tags</h2>
342
342
<sectionclass="slide" data-markdown>
343
343
##Class exercise: Add a navigation
344
344
345
-
Let's go back to **index.html** and add an unordered list, before `<header>`, as a navigation menu for the three pages: **Home**, **About**, **Contact**.
345
+
Let's go back to **index.html** and add an unordered list, *before* `<header>`, as a navigation menu for the three pages: **Home**, **About**, **Contact**.
346
346
347
347
It should look like this:
348
348
@@ -354,7 +354,7 @@ <h2>Nesting HTML tags</h2>
354
354
355
355
The purpose for creating page navigation is to link to other pages. In addition to creating a list, we'll also need to add links to navigate between the three pages.
356
356
357
-
Links are represented by the `<a>` (anchor) tag. Unlike the tags we've looked at so far, anchor tags need additional information to specify a link location. An **attribute** can provide additional information and is added inside the opening tag.
357
+
Links are represented by the `<a>` (anchor) tag. Unlike the tags we've looked at so far, anchor tags need additional information to specify where to link to. An **attribute** can provide additional information and is added inside the opening tag.
Sometimes, multiple HTML elements need to be grouped together for organization and/or for styling. For example, the heading contains multiple elements (name and tagline) as well as the navigation on the about and contact page.
387
+
Sometimes, multiple HTML elements need to be grouped together for organization and/or for styling. For example, the `header` contains multiple elements (name and tagline) as well as the navigation on the about and contact page.
388
388
389
-
Prior to HTML5, the `<div>` tag was used for grouping elements together to create page layouts. The header and footer of the page might look something like this:
389
+
Prior to HTML5, the `<div>` tag was used for grouping elements together to create page layouts. The header of the page might look something like this:
<p>Void tags don’t format content — instead, they embed objects in the page. These tags <strong>do not</strong> come in pairs since they do not wrap content like the other tags we’ve been using so far. They <em>are</em> the content!</p>
516
-
517
-
<p>The syntax is slightly different in the latest version of HTML so you may see it written in two ways. Prior to HTML5, these tags were self-closed with a forward slash (<code>/</code>) immediately before the right angled bracket (<code>></code>). In HTML5, void tags are not required to self close.</p>
518
-
519
-
<p>A common void tag is the <code><br /></code> or <code><br></code> tag used to create a line break.</p>
<p>Another example of a void element is the horizontal rule, <code><hr></code> or <code><hr /></code>.</p>
527
-
528
-
<!-- example -->
529
-
<hr>
530
-
</section>
531
-
532
512
<sectionclass="slide" data-markdown>
533
513
##Image Types
534
514
There are many different file types that can be used for the web. Each type is best suited for specific kinds of images. Use the format that maintains the best quality while reducing the file size.
<p>Images are another example of a void element. Just like links, the image tag also requires an <em>attribute</em> to define the file path of the image file. However, it uses the <code>src</code> attribute (not <code>href</code>). The value can be an absolute or relative path. The below is an example of an absolute path.</p>
542
+
<p>Images are an example of a void element. It doesn't need a closing tag because it <em>is</em> the content. Read more about void elements <ahref="framework/extras-void-elements.html">here</a>.</p>
543
+
544
+
<p>Just like links, the image tag also requires an <em>attribute</em> to define the file path of the image file. However, it uses the <code>src</code> attribute (not <code>href</code>). The value can be an absolute or relative path. The below is an example of an absolute path.</p>
CSS is a different language from HTMl and has its own syntax rules though the two are closely paired. CSS is made up of rules that refer to HTML elements and define what those elements should look like.
642
+
Though CSS and HTML are closely paired, CSS is a different language and has its own syntax rules. CSS is made up of *declarations* that refer to HTML elements and define what those elements should look like.
661
643
662
644
CSS separates content (i.e. text) from presentation (i.e. text colour) and helps to reduce redundancy.
663
645
@@ -787,12 +769,14 @@ <h2>Write some CSS</h2>
787
769
788
770
Create a new CSS file by selecting **File > New File** in Sublime Text or use a shortcut, **CMND/CNTRL + N**. Name the file with a **.css** extension. Some commonly used names are **global.css**, **main.css** or **style.css**.
789
771
790
-
Remember, external stylesheets are added using the `<link>` tag.
772
+
Let's add it to **about.html**.
773
+
774
+
**Protip!** Can't remember the syntax? Sublime Text has a shortcut. Simply type "link" with no brackets and press tab. Voila!
791
775
792
776
```
793
777
<link rel="stylesheet" href="css/style.css">
794
778
```
795
-
**Protip!** Can't remember the syntax? Sublime Text has a shortcut. Simply type "link" with no brackets and press tab. Voila!
779
+
796
780
797
781
Let's do a quick check to see if it works and is linked properly by adding a background color on the entire viewport as a test.
<p>Explain what each property does while updating each example in the code editor.</p>
881
+
</div>
894
882
</section>
895
883
896
884
<sectionclass="slide" data-markdown>
@@ -945,7 +933,7 @@ <h2>Lunchtime exercise!</h2>
945
933
<p>Feel free to peek at the next exercise ;)</p>
946
934
947
935
<divclass="presenter-notes">
948
-
<p>Aim to get to lunch by 12:30-1:00pm. A 45min lunch is recommended. Let the learners know this is optional but most people tend to enjoy continuing with a bit of exercises over the break and this will help speed up the next exercise.</p>
936
+
<p>Aim to get to lunch by 12:30-1:00pm. A 45min lunch is recommended. 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.</p>
0 commit comments