Skip to content

Commit 771da29

Browse files
committed
Expand this tutorial based on confused areas last night.
There were a couple of typos in this tutorial, as well as some parts which tripped up the students I worked with last night. I've cleaned those typos up, added some explanations for confusing bits, removed some technical language in favour of plain English, and simplified some other sections.
1 parent 3a56149 commit 771da29

1 file changed

Lines changed: 51 additions & 26 deletions

File tree

html/lesson1/tutorial.md

Lines changed: 51 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ We will be building this [example page](http://codebar.github.io/tutorials/html/
3333

3434
### HTML element anatomy
3535

36-
An **element** is an HTML component _eg. paragraph, heading, table, list etc_
36+
An **element** is an HTML building block. There are paragraphs, headings, tables, links, lists, and many more.
3737

38-
**Tags**, mark the opening and closing of an element. They contain elements that show their purpose
38+
**Tags** mark the opening and closing of an element. They often contain other elements and text.
3939

4040
`<tagname>some content</tagname>`
4141

@@ -44,13 +44,21 @@ An **element** is an HTML component _eg. paragraph, heading, table, list etc_
4444
<h1>I am a heading</h1>
4545
```
4646

47-
Some elements are standalone, as they cannot contain anything else <tagname/>
47+
Some elements are standalone, as they cannot contain anything else. They look like this: `<tagname/>`
4848

4949
```html
5050
<br/>
5151
<img/>
5252
```
5353

54+
### Comments
55+
56+
We can use a special kind of tag to add notes to our page. The computer will ignore them, but programmers can read them and understand how your code works.
57+
58+
```html
59+
<!-- Note to self: this is where the header goes -->
60+
```
61+
5462
### DOCTYPE and HTML tags
5563

5664
The doctype is the first thing that must be defined in an HTML page.
@@ -81,7 +89,7 @@ The **body** contains what is visible to the user.
8189

8290
## Let's get started!
8391

84-
Let's start by defining the basic structure of our website.
92+
Let's start by defining the basic structure of our website. Create a new folder for your work called "HTML tutorial 1". Then create a new file called "index.html" in that folder. Here's what you should put in it:
8593

8694
```html
8795
<!DOCTYPE html>
@@ -90,11 +98,16 @@ Let's start by defining the basic structure of our website.
9098
<title>I love owls</title>
9199
</head>
92100
<body>
93-
<!-- content -->
101+
<!-- Put your page content in this body tag! -->
94102
</body>
95103
</html>
96104
```
97105

106+
> If you load this in your browser, do you see anything on the page?
107+
108+
> What about in the browser's title bar or tab bar?
109+
110+
98111
### Element: Heading
99112

100113
Headings come in many sizes
@@ -106,7 +119,7 @@ Headings come in many sizes
106119
##### `<h5>Heading</h5>`
107120
###### `<h6>Heading</h6>`
108121

109-
Add a heading to your page
122+
Add a heading to your page. Place it inside the page body.
110123

111124
```html
112125
<h1>Owls!</h1>
@@ -126,7 +139,7 @@ Elements can be nested inside each other. For example, by putting the `<h1>` ins
126139

127140
Putting content into a `<p>` will make it look like a paragraph structure. This helps make the content of a page easier to read.
128141

129-
Add the following to your page, after the title
142+
Add the following to your page body, after the `<h1>` heading:
130143

131144
```html
132145
<p>
@@ -179,10 +192,11 @@ Let's add a link to the bottom of our paragraph
179192

180193
### Element: Div `<div>`
181194

182-
Div stands for _division_. It creates sections in an HTML document.
183-
We can use a div to contain out paragraph.
195+
Div stands for _division_. It creates sections in an HTML document. They don't affect the layout of your page - but they do help you group related elements together.
184196

185-
Wrap your paragraph in a div and add a heading to it
197+
We can use a div to contain our paragraph.
198+
199+
Wrap your existing paragraph in a div and add a new heading to it:
186200

187201
```html
188202
<div>
@@ -198,6 +212,7 @@ Wrap your paragraph in a div and add a heading to it
198212
</div>
199213
```
200214

215+
201216
### Element: List `<li>`
202217

203218
There are two types of lists, **ordered** and **unordered**.
@@ -214,9 +229,11 @@ Let's list the reasons we like owls so much under the main heading of the page (
214229
</ol>
215230
```
216231

232+
> If you wanted to make this an unordered list, what would you change? How could you check it worked? Try it, then change your list back to an ordered list.
233+
217234
### Element: Image `<img>`
218235

219-
So far we've learned a lot about how to add text to our page. But how about some media?
236+
So far we've learned a lot about how to add text to our page. But how about something to look at?
220237

221238
Let's add some images!
222239

@@ -234,7 +251,7 @@ Images are primarily made up of three attributes
234251

235252
* the `<img>` tag
236253
* the `src` attribute, which lets the page know what image we want to view
237-
* the `alt` attribute, where we describe our image
254+
* the `alt` attribute, where we describe our image for people who can't see it
238255

239256
Before the main heading of the page, add the following
240257

@@ -244,10 +261,14 @@ Before the main heading of the page, add the following
244261
</div>
245262
```
246263

264+
> Remember: the `<head>` section is not the same as a heading! Make sure your new `<div>` is in the page body.
265+
247266
> Can you see the codebar logo? What happens when you change logo to logo1?
248267
249-
Let's add some more, this time, contained in a list.
250-
Do this underneath `<h2>Why do I like owls so much?</h2>`
268+
> If you can't see your image, make sure you put it in the `images` folder.
269+
270+
Let's add some more images. This time, we'll put them in a list.
271+
Do this underneath the `<h2>Why do I like owls so much?</h2>` heading.
251272

252273
```html
253274
<ul>
@@ -261,11 +282,11 @@ So a list can not only contain text, but other elements as well.
261282

262283
### Adding a link on multiple elements
263284

264-
Links can contain not just text, but images or even a number of elements within.
285+
Links can contain many elements - not just text.
265286

266-
Let's link some pictures and text to a video. It can be handy when we want the user to get to where we want them without needing to click on text.
287+
Let's use some pictures and text to link to a video. It can be handy when we want the user to get to where we want them without needing to click on text.
267288

268-
Add that underneath the ordered list we defined earlier.
289+
Add this underneath the ordered list about why we like owls.
269290

270291
```html
271292
<div>
@@ -279,31 +300,35 @@ Add that underneath the ordered list we defined earlier.
279300
```
280301

281302
> Click any of the images. Can you get to the link's page?
303+
> What happens if you take the `<br/>` tag out? Remember to put it back afterwards!
304+
305+
### Special characters and more formatting
306+
307+
Some characters have special meaning in HTML. For instance, we use < and > to make HTML tags, and we use " to wrap our attributes. But what if we wanted to use those characters in our page?
282308

283-
### ASCII and more formatting
309+
One way is to use **HTML entities**. These have an ampersand, a name, then a semicolon. Here's the HTML entity for a quote character: `&quot`.
284310

285-
**ASCII** code is a way to represent text in ways that all computers can understand.
286-
[Here](http://htmlandcssbook.com/extras/html-escape-codes/) is a list with codes, their representation and HTML number.
311+
You can also use a numerical format to produce special characters. [Here's a list](http://htmlandcssbook.com/extras/html-escape-codes/) of some common entities.
287312

288-
Add a small rhyme to your page, wrapped with quotes using ASCII code.
313+
Add a small rhyme to your page, wrapped with quotes using HTML entities.
289314

290315
```html
291316
<div>
292317
<p>
293318
<strong>
294319
<em>
295-
&#34;A wise old owl sat on an oak; The more he saw the less he spoke; <br>
296-
The less he spoke the more he heard; Why aren&#39;t we like that wise old bird?&#34;
320+
&quot;A wise old owl sat on an oak; The more he saw the less he spoke; <br>
321+
The less he spoke the more he heard; Why aren't we like that wise old bird?&quot;
297322
</em>
298323
</strong>
299324
</p>
300-
<small>- nursery rhyme</small>
325+
<small>&mdash; nursery rhyme</small>
301326
</div>
302327
```
303328

304329
**small** is another html formatting element you can use.
305330

306-
> Have you noticed how the character `&#34;` renders on the page?
331+
> Have you noticed how the character `&mdash;` renders on the page?
307332
308333
### mailto links `<a>`
309334

@@ -323,7 +348,7 @@ The difference between links and mailto links, is the content defined in the **h
323348

324349
> What happens when you click the first link?
325350
326-
> What happens when you click the second link?
351+
> What happens when you click the second link? How is it different?
327352
328353
> What happens when you add `&body=Owls are amazing` to the second link?
329354

0 commit comments

Comments
 (0)