├── .editorconfig
├── 01-rules
├── 01-fix-this-html.html
├── index.md
└── under-construction.gif
├── 02-tables
├── 02-tables.html
├── example.png
└── index.md
├── 03-nested-lists
├── 03-nested-lists.html
├── index.md
└── lists_example.html
├── 04-sectioning-elements
├── 04-sectioning-elements.html
├── index.md
├── sectioning-elements.png
└── sections.css
├── 05-all-elements
├── 05-all-elements.html
└── index.md
├── 06-images
├── 06-images.html
├── img
│ ├── cat_typing.webp
│ ├── logo_onja.png
│ ├── logo_onja.webp
│ ├── logo_onja_disk.svg
│ ├── onja_crew.jpg
│ └── onja_crew.webp
└── index.md
├── 07-weekend-blog
└── index.md
├── 08-log-in-form
├── 08-log-in-form.html
└── index.md
├── 09-correct-fields
├── 09-correct-fields.html
├── forms.css
└── index.md
├── 10-form-to-sheets
├── 10-form-to-sheets.html
└── index.md
├── 11-inline-markup
├── 11-inline-markup.html
└── index.md
├── 12-clean-code
├── 12-clean-code.html
└── index.md
├── 13-semantics
├── 13-semantics.html
├── index.md
└── markup.png
├── 14-blog-design
├── 14-blog-design.html
├── blog_design.png
└── index.md
├── 15-rich-media
├── 15-rich-media.html
├── audio
│ ├── early-high_wails.ogg
│ ├── late-high_wails-long.ogg
│ ├── late-high_wails.ogg
│ ├── moan.ogg
│ └── purr.ogg
├── caption
│ └── chip.vtt
├── css
│ └── rich-media.css
├── index.md
├── js
│ └── canvas.js
└── video
│ └── chip.mp4
├── 16-project-html
└── index.md
├── README.md
├── fork-button.png
└── template.html
/.editorconfig:
--------------------------------------------------------------------------------
1 | # EditorConfig helps developers define and maintain consistent
2 | # coding styles between different editors and IDEs
3 | # See: editorconfig.org
4 |
5 | root = true
6 |
7 | [*]
8 |
9 | indent_style = space
10 | indent_size = 2
11 | end_of_line = lf
12 | charset = utf-8
13 | trim_trailing_whitespace = true
14 | insert_final_newline = true
15 |
--------------------------------------------------------------------------------
/01-rules/01-fix-this-html.html:
--------------------------------------------------------------------------------
1 |
2 |
My first HTML page
3 |
4 | My first site
5 |
6 | I'm sorry, but this page is still under construction.
7 |
I love learning html
8 |
9 |
--------------------------------------------------------------------------------
/01-rules/index.md:
--------------------------------------------------------------------------------
1 | # HTML exercise 01: Fix this HTML
2 |
3 | There are a number of rules associated with HTML elements, attributes, and HTML in general.
4 |
5 | Fix the file `01-fix-this-html.html` by making sure all the HTML inside is valid, and working according to the rules. Use the W3C Markup Validator if you want.
6 |
7 | Save, add, and then `commit` your changes in your forked repo. Make sure to `push`!
--------------------------------------------------------------------------------
/01-rules/under-construction.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/onja-org/html-exercises/56ba8f2ee6858bd9b172accafed7614033a41565/01-rules/under-construction.gif
--------------------------------------------------------------------------------
/02-tables/02-tables.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 02: Tables
6 |
7 |
8 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/02-tables/example.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/onja-org/html-exercises/56ba8f2ee6858bd9b172accafed7614033a41565/02-tables/example.png
--------------------------------------------------------------------------------
/02-tables/index.md:
--------------------------------------------------------------------------------
1 | # HTML exercise 02: Tables
2 |
3 | In the accompanying file `02-tables.html` you'll find a lone `` element.
4 |
5 | Add the necessary HTML to this table, to make it look like this:
6 |
7 | 
8 |
9 | Save, add, and then `commit` your changes in your forked repo. Make sure to `push`!
--------------------------------------------------------------------------------
/03-nested-lists/03-nested-lists.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | 03: Nested lists
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/03-nested-lists/index.md:
--------------------------------------------------------------------------------
1 | # HTML exercise 03: Nested lists
2 |
3 | In the accompanying file `03-nested-lists.html` you'll find an empty `` element. Let's try make an HTML nested list inside that HTML file.
4 |
5 | Make it look like the following:
6 |
7 | ---
8 |
9 | - Baboons
10 | - Chimpanzees
11 | - Gibbons
12 | - Gorillas
13 | - Lemurs
14 | 1. Aye-aye
15 | - Scary fingers
16 | - Scrawny head
17 | - Not so cute
18 | 1. Grey Mouse Lemur
19 | - Super cute
20 | - Really small
21 | 1. Ring-tailed Lemur
22 | - Monkeys
23 |
24 | ---
25 |
26 | Save, add, and then `commit` your changes in your forked repo. Make sure to `push`!
--------------------------------------------------------------------------------
/03-nested-lists/lists_example.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Lists
7 |
17 |
18 |
19 |
22 |
23 |
29 |
30 |
31 |
32 |
35 |
36 | Item
37 | Item
38 |
39 |
40 |
41 |
44 |
45 |
46 | Item
47 |
48 |
49 | Item
50 |
51 |
52 |
53 |
54 |
55 |
56 | Unordered list inside a nav
57 |
58 |
59 |
67 |
68 |
69 |
70 |
71 |
72 | Definition Lists
73 |
74 |
75 | Obsolete
76 | Out of date
77 | Expired
78 | Default
79 | Automatically selected or chosen
80 | Periphery
81 | Something on the border
82 | Edge of your conciousness
83 |
84 |
85 |
86 |
87 |
88 |
--------------------------------------------------------------------------------
/04-sectioning-elements/04-sectioning-elements.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | 04: Sectioning elements
7 |
8 |
9 |
10 |
11 |
12 | Learning
13 | HTML
14 |
15 |
16 | Sections
17 |
18 |
19 | Sectioning elements are easy to use once you know what each element does.
20 |
21 |
22 | Try to learn their purpose, that’ll make it clearer.
23 |
24 |
25 | ←
26 | Go back to the index
27 |
28 |
29 |
30 | Email me for more information
31 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/04-sectioning-elements/index.md:
--------------------------------------------------------------------------------
1 | # HTML exercise 04: Sectioning elements
2 |
3 | In the accompanying file `04-sectioning-elements.html` please divide the content up into various types of elements, as illustrated in this diagram below.
4 |
5 | **Hint**: You shouldn't have to delete any of the existing HTML. Instead, wrap the contents of the document with the new elements, in the right way.
6 |
7 | 
8 |
9 | Save, add, and then `commit` your changes in your forked repo. Make sure to `push`!
--------------------------------------------------------------------------------
/04-sectioning-elements/sectioning-elements.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/onja-org/html-exercises/56ba8f2ee6858bd9b172accafed7614033a41565/04-sectioning-elements/sectioning-elements.png
--------------------------------------------------------------------------------
/04-sectioning-elements/sections.css:
--------------------------------------------------------------------------------
1 | /* Set some defaults */
2 | body {
3 | font-family: sans-serif;
4 | font-size: 100%;
5 | margin: 0;
6 | max-width: 30rem;
7 | }
8 | /* Give each sectioning element some spacing */
9 | header,
10 | main,
11 | article,
12 | nav,
13 | footer {
14 | position: relative;
15 | padding: 0.25rem 1rem;
16 | }
17 |
18 | /* Create pseudo-elements that give each element a key */
19 | header::before,
20 | main::before,
21 | article::before,
22 | nav::before,
23 | footer::before {
24 | position: absolute;
25 | top: .25rem;
26 | right: .25rem;
27 | font-size: .75rem;
28 | font-weight: bold;
29 | font-family: monospace;
30 | }
31 |
32 | /* Now set the colours and attribution for each */
33 | header {
34 | background-color: rgb(206, 211, 255);
35 | }
36 | main {
37 | padding: 2rem;
38 | background-color: rgb(255, 196, 196);
39 | }
40 | article {
41 | padding: 2rem;
42 | background-color: rgb(252, 252, 167);
43 | border: 1px solid rgb(193, 173, 23);
44 | }
45 | nav {
46 | background-color: rgb(250, 207, 250);
47 | }
48 | footer {
49 | background-color: rgb(197, 255, 197);
50 | }
51 |
52 | /* And the right text for each element's pseudo-element */
53 | header::before {
54 | content: '';
55 | color: rgb(78, 89, 255);
56 | }
57 | main::before {
58 | content: '';
59 | color: rgb(215, 80, 80);
60 | }
61 | article::before {
62 | content: '';
63 | color: rgb(193, 173, 23);
64 | }
65 | nav::before {
66 | content: '';
67 | color: rgb(204, 34, 213);
68 | }
69 | footer::before {
70 | content: '';
71 | color: rgb(19, 179, 27);
72 | }
73 |
74 | /* And finally, any overrides */
75 | main header {
76 | border: 1px solid rgb(78, 89, 255);
77 | }
--------------------------------------------------------------------------------
/05-all-elements/05-all-elements.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | 05: All elements
7 |
8 |
9 |
10 |
13 |
14 |
15 |
16 |
17 |
18 | <a>
19 |
20 |
21 |
22 | The anchor element (<a>
) is one of the fundamental elements in HTML.
23 |
24 |
25 | It allows a user to click on the link text it provides, and navigates to that link's location.
26 |
27 |
28 |
29 |
30 |
31 | <abbr>
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
--------------------------------------------------------------------------------
/05-all-elements/index.md:
--------------------------------------------------------------------------------
1 | # HTML exercise 05: All elements
2 |
3 | In the accompanying file `05-all-elements.html` we want to list as many HTML elements as we can, and we're going to use a definition list to do it. So far, we've come to know 40-50 elements. Can you list and describe them all?
4 |
5 | I've started your work with the first two elements. Take a look. 🤓
6 |
7 | > **Note:** In the ``, use a `` element to write out each element, in alphabetical order. You'll notice there's a special way to rewrite the Less than (`<`) and Greater than (`>`) characters.
8 |
9 | Save, add, and then `commit` your changes in your forked repo. Make sure to `push`!
--------------------------------------------------------------------------------
/06-images/06-images.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | 06: Images
8 |
9 |
24 |
25 |
26 |
27 |
28 | Images
29 |
30 |
31 |
32 |
54 |
55 |
56 |
57 |
58 |
62 |
63 |
64 | JPEGs are…
65 |
66 |
67 |
68 |
69 |
70 |
74 |
75 |
76 | PNGs are…
77 |
78 |
79 |
80 |
81 |
82 |
83 | As an SVG
84 | Scalable Vector Graphics
85 |
86 |
87 |
88 | SVGs are…
89 |
90 |
91 |
92 |
93 |
94 |
95 | As a WebP
96 | Web PNG
97 |
98 |
99 |
100 | WebPs are…
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
--------------------------------------------------------------------------------
/06-images/img/cat_typing.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/onja-org/html-exercises/56ba8f2ee6858bd9b172accafed7614033a41565/06-images/img/cat_typing.webp
--------------------------------------------------------------------------------
/06-images/img/logo_onja.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/onja-org/html-exercises/56ba8f2ee6858bd9b172accafed7614033a41565/06-images/img/logo_onja.png
--------------------------------------------------------------------------------
/06-images/img/logo_onja.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/onja-org/html-exercises/56ba8f2ee6858bd9b172accafed7614033a41565/06-images/img/logo_onja.webp
--------------------------------------------------------------------------------
/06-images/img/logo_onja_disk.svg:
--------------------------------------------------------------------------------
1 |
2 | Onja.org
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/06-images/img/onja_crew.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/onja-org/html-exercises/56ba8f2ee6858bd9b172accafed7614033a41565/06-images/img/onja_crew.jpg
--------------------------------------------------------------------------------
/06-images/img/onja_crew.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/onja-org/html-exercises/56ba8f2ee6858bd9b172accafed7614033a41565/06-images/img/onja_crew.webp
--------------------------------------------------------------------------------
/06-images/index.md:
--------------------------------------------------------------------------------
1 | # HTML exercise 06: Images
2 |
3 | In the accompanying file `06-images.html` you'll find 5 sections describing each of the web-friendly image types we can use with an image element or ` `.
4 |
5 | In this exercise, you first need to link up each of the examples to their associated files by adjusting the source attribute (`src`) to match the file in the `img` subfolder.
6 |
7 | You'll notice that the different file types are better suited for certain types of imagery.
8 |
9 | Can you associate each item in the following list, with each file type?
10 |
11 | - Good for photos
12 | - Best for vector images
13 | - Best for everything except vectors, but not widely supported.
14 | - Great for graphics, charts, and other generated images.
15 |
16 | Save, add, and then `commit` your changes in your forked repo. Make sure to `push`!
17 |
--------------------------------------------------------------------------------
/07-weekend-blog/index.md:
--------------------------------------------------------------------------------
1 | # HTML exercise 07: A blog in a weekend
2 |
3 | This weekend, let's create a weblog!
4 |
5 | We can use the skills we've learned, and the tools we know to create our blog pretty easily.
6 |
7 | A blog is a series of posts over time, that capture your thoughts and publish them to the World Wide Web.
8 |
9 | ## What you'll need
10 |
11 | You'll need to:
12 |
13 | - [Create a new repository](https://github.com/new). Call it `blog`, make it public.
14 | - Create (and push) a new branch called `gh-pages`.
15 | - You'll then need to enable 'GitHub Pages' under the repository's settings, using the `gh-pages` branch to publish your blog.
16 | - Take note of the URL of your blog. It should be something like: https://YOUR_USER_NAME.github.io/blog/
17 |
18 | ## The code you need to write
19 |
20 | Your blog should have the following:
21 |
22 | - An index page, `index.html` in the root of the repo.
23 | - This file will act as your homepage. So make it cheery, inviting, and have it list links to all the posts you write.
24 | - This file will also introduce you. Maybe it's a good idea to tell everyone your pen-name. 🤓
25 | - An HTML file per blog post.
26 | - What you call its filename is up to you, but I'd suggest using a proper date in the filename, or organising these files in folders that have the date. That way you can easily set the order of the posts by date.
27 | - You'll need at least a good title per blog post, and a few paragraphs, and/or images to go with that title.
28 | - Good structure in your HTML. Use the sectioning elements we learned earlier.
29 | - Have a link back to the index, so your readers can browse to the next post.
30 | - **Bonus**: Create a template HTML file that you can copy for each post you will create later.
31 | - **Extra Special Bonus**: Create an RSS XML file to accompany your blog posts. 🚀
32 |
33 | ## Other decisions
34 |
35 | Decide on a theme for your blog, your readers will thank you for that.
36 |
37 | Here are some ideas:
38 |
39 | - A blog that captures your learnings at Onja.
40 | - A blog that shares what you're thinking or feeling. Maybe a situation you're dealing with is really difficult. By expressing that, you might find some solutions.
41 | - Crazy ideas you've had for websites, or weaving, or how to improve your daily life.
42 | - Your own idea? The sky is the limit!
43 |
44 | ## The process you need to follow
45 |
46 | 1. Work in `master`.
47 | 1. Create a new file (or folder & file) to contain your new post.
48 | 1. Copy over the template contents to the new file.
49 | 1. Make your edits to the new file, writing about whatever has been on your mind.
50 | 1. Once you're done, create a new list-item in your index that points to your new post HTML.
51 | 1. Save, `add`, `commit`, and `push` to `master`.
52 | 1. When you've committed and pushed, `merge` your `master` changes to `gh-pages` to publish your blog updates.
53 |
54 | If you've done everything right, your new blog post will then be available via that URL mentioned earlier.
55 |
56 |
--------------------------------------------------------------------------------
/08-log-in-form/08-log-in-form.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | 08: A log in form
8 |
9 |
10 |
11 |
12 |
13 | Hello again!
14 |
15 |
16 |
17 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/08-log-in-form/index.md:
--------------------------------------------------------------------------------
1 | # HTML exercise 08: A log in form
2 |
3 | Forms help users submit and save information with web servers.
4 |
5 | There are many HTML elements we use when working with forms, this exercise will introduce you to some of the fundamental elements.
6 |
7 | In the accompanying file, `08-log-in-form.html`, add the necessary markup, so that user can enter their e-mail address and password.
8 |
9 | The web server is expecting the following fields:
10 |
11 | - `username`: The user's email address
12 | - `password`: The user's password.
13 |
14 | Both fields are required.
15 |
16 | The user's login details must be `POST`ed to the following URL: `/log-in`
17 |
18 | Save, `add`, and then `commit` your changes in your forked repo. Make sure to `push`!
19 |
--------------------------------------------------------------------------------
/09-correct-fields/09-correct-fields.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | 09: Choosing the correct field
8 |
9 |
10 |
11 |
12 |
18 |
19 |
26 |
27 |
28 |
60 |
61 |
82 |
83 |
117 |
118 |
152 |
153 |
185 |
186 |
187 |
188 |
--------------------------------------------------------------------------------
/09-correct-fields/forms.css:
--------------------------------------------------------------------------------
1 | body {
2 | max-width: 500px;
3 | margin: 0 auto;
4 | font-family: sans-serif;
5 | }
6 |
7 | nav {
8 | margin-bottom: 4rem;
9 | }
10 |
11 | button {
12 | -webkit-appearance: none;
13 | padding: .75rem 1.5rem;
14 | border: 1px solid rgb(5, 133, 41);
15 | border-radius: 5px;
16 | background-color: lightgreen;
17 | font-weight: bold;
18 | }
19 |
20 | form + form {
21 | margin-top: 4rem;
22 | }
23 |
24 | fieldset {
25 | border: #ccc solid 1px;
26 | padding: 1rem;
27 | border-radius: 5px;
28 | }
29 |
30 | fieldset + fieldset,
31 | fieldset + div {
32 | margin-top: 1rem;
33 | }
34 |
35 | legend {
36 | padding: 0 1rem;
37 | }
38 |
39 | button,
40 | select,
41 | textarea,
42 | input {
43 | font-size: 1rem;
44 | }
45 |
--------------------------------------------------------------------------------
/09-correct-fields/index.md:
--------------------------------------------------------------------------------
1 | # HTML exercise 09: Choosing the correct field
2 |
3 | There are many ways to represent the data the server needs in an HTML `
21 |
22 |
23 |
--------------------------------------------------------------------------------
/10-form-to-sheets/index.md:
--------------------------------------------------------------------------------
1 | # HTML exercise 10: Form to Google Sheets
2 |
3 | Now let's heat things up a bit! All this time, we've been trying to build forms, but never see them working as they should.
4 |
5 | I've built [a little Script Add-on](https://script.google.com/a/onja.org/d/1MemwIrVw-0kOBR-JfCeJnUPW8CKWq0hzPSdngnJsmALJvO3dcRiahXxb/edit?usp=sharing) for a [special Google Sheet](https://docs.google.com/spreadsheets/d/1Vnkb5rE1kgXFMt2So3RwfvfLwayVtATt1o9NM-ry9UI/edit?usp=sharing).
6 |
7 | Take a look at the `Form Data` Sheet. Do those fields look familiar? 🤓
8 |
9 | Now, using those header cells as field names, build an HTML form that a user can use to capture Malagasy Artists.
10 |
11 | Pay special attention to the following:
12 |
13 | - `contributor` is you! Specify your first name as the value for this field.
14 | - `genre` could be a list of genres the user can choose from, but we only want their primary genre
15 | - `artist_id` should apply our file-naming rule, and is required.
16 | - `artist_name` is required
17 | - The rest of the fields are optional.
18 |
--------------------------------------------------------------------------------
/11-inline-markup/11-inline-markup.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | 11: Inline markup
8 |
9 |
10 |
11 |
17 |
18 |
19 |
20 |
21 | "Wait!" shouted Jesse.
22 |
23 |
24 |
25 |
26 |
27 |
28 | The time is now 2pm, on Wednesay the 12th of February, 2020.
29 |
30 |
31 |
32 |
33 |
34 |
35 | The elements H and O, bond as H20, or water (as it is colloquaially known).
36 |
37 |
38 |
39 |
40 |
41 |
42 | Editor's Notes:
43 |
44 | Please use CTRL+B to bold this word: Critical
45 | Please use CTRL+I to italicise this word: Doubtful
46 |
47 | Please underline this word: Thinking
48 | Please put a line through this word: Assuming
49 |
50 | Please show that the word 'slow' was removed, and 'quick' added in its place in the following sentence:
51 | "The slow brown fox jumped over the lazy dog."
52 |
53 |
54 |
55 |
56 |
57 |
58 | "Woah! 'that' was unexpected!" exclaimed Keith.
59 | Curiously, Jesse looked at the output on Keith's screen and it said:
60 |
61 | Unexpected value for argument 'that'
62 | - in function clickHandler, line 12
63 | - called from function anonymous, line 34
64 |
65 |
66 |
67 |
68 |
69 |
70 | Your search term: 'Helicopter' was found in the following documents:
71 |
72 |
73 |
74 | Bell 222 :
75 | The Model 222 is a helicopter made by the Bell Helicopter Corporation.
76 |
77 |
78 |
79 |
80 |
81 |
82 |
--------------------------------------------------------------------------------
/11-inline-markup/index.md:
--------------------------------------------------------------------------------
1 | # HTML exercise 11: Inline markup
2 |
3 | There are many HTML elements that are designed to wrap a few words at a time, to add emphasis, attribution, or show changes. These elements can typically be nested with one another, and belong inside other block-like elements like ``, or `
`.
4 |
5 | In this exercise, you'll need to use the inline elements mentioned below, on the appropriate words in the `11-inline-markup.html` file.
6 |
7 | Some of the inline elements:
8 |
9 | - ``
10 | - ``
11 | - ``
12 | - ``
13 | - ``
14 | - ``
15 | - ``
16 | - ``
17 | - ``
18 | - ``
19 | - ``
20 | - ``
21 | - ``
22 | - ``
23 | - ``
24 | - ``
25 | - ``
26 | - ``
27 | - ``
28 | - ``
29 | - ``
30 |
31 | Save, `add`, and then `commit` your changes in your forked repo. Make sure to `push`!
32 |
--------------------------------------------------------------------------------
/12-clean-code/12-clean-code.html:
--------------------------------------------------------------------------------
1 | Log in to your account
4 |
Log in to your Swipe account Can’t access your account?
11 |
12 |
--------------------------------------------------------------------------------
/12-clean-code/index.md:
--------------------------------------------------------------------------------
1 | # HTML Exercise 12: Clean Code
2 |
3 | Sometimes you inherit - or have to work on - someone else's code.
4 |
5 | In this exercise, you have to clean up the whitespace in the corresponding `12-clean-code.html` file.
6 |
7 | Try doing it **without** using `Format Document` from the command palette.
8 |
9 | Now is a good time to practice your indenting, and applying the rules you learned about writing clean HTML.
10 |
--------------------------------------------------------------------------------
/13-semantics/13-semantics.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | 13: Semantic HTML
8 |
9 |
10 |
11 |
12 |
13 | Semantic HTML
14 |
15 |
16 |
17 |
18 |
19 | A menu of a list of links
20 |
27 |
28 |
29 |
30 | A profile update form
31 |
44 |
45 |
46 |
47 | An excerpt
48 |
57 |
58 |
59 |
78 |
79 |
80 | Search results
81 |
114 |
115 |
116 | A definition
117 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
--------------------------------------------------------------------------------
/13-semantics/index.md:
--------------------------------------------------------------------------------
1 | # HTML Exercise 13: Semantic HTML
2 |
3 | In this exercise, we're going to turn English instructions into HTML. e.g.…
4 |
5 | > Make a link to https://dndbeyond.com that says 'Dungeons and Dragons'.
6 |
7 | …becomes…
8 |
9 | ```
10 |
11 | Dungeons and Dragons
12 |
13 | ```
14 |
15 | Open `13-semantics.html` and write out the correct, and most meaningful HTML you can, for each section.
16 |
--------------------------------------------------------------------------------
/13-semantics/markup.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/onja-org/html-exercises/56ba8f2ee6858bd9b172accafed7614033a41565/13-semantics/markup.png
--------------------------------------------------------------------------------
/14-blog-design/14-blog-design.html:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/onja-org/html-exercises/56ba8f2ee6858bd9b172accafed7614033a41565/14-blog-design/14-blog-design.html
--------------------------------------------------------------------------------
/14-blog-design/blog_design.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/onja-org/html-exercises/56ba8f2ee6858bd9b172accafed7614033a41565/14-blog-design/blog_design.png
--------------------------------------------------------------------------------
/14-blog-design/index.md:
--------------------------------------------------------------------------------
1 | # Weekend Project: Mockup to HTML
2 |
3 | As a front-end web developer, you're going to be turning design work into HTML (and CSS) on an almost daily basis.
4 |
5 | Let's practice this by looking at a reference design, and start cutting it up into the most appropriate HTML we can think of.
6 |
7 | In this folder, you'll find `blog_design.png`. Your job is to write the HTML for this page design in `14-blog-design.html`, which you'll then hand over to a CSS developer to complete.
8 |
9 | You'll need to:
10 |
11 | - write everything from scratch, and base it off your own interpretation of what element is the best for each case.
12 | - make sure your document is well-structured, i.e. use sectioning elements.
13 | - make sure you use headings properly
14 | - make your own interpretation about what URLs the links go to.
15 | - not worry about the way it looks. Your document should be easy to understand without CSS.
16 |
17 | Also, take note, there are no images required for this HTML.
18 |
19 | Good luck!
20 |
--------------------------------------------------------------------------------
/15-rich-media/15-rich-media.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | 15: Rich Media
8 |
9 |
10 |
11 |
12 |
13 |
14 | Rich Media examples
15 |
16 |
17 |
18 |
19 |
22 |
23 |
24 |
25 |
28 |
29 |
30 |
31 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/15-rich-media/audio/early-high_wails.ogg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/onja-org/html-exercises/56ba8f2ee6858bd9b172accafed7614033a41565/15-rich-media/audio/early-high_wails.ogg
--------------------------------------------------------------------------------
/15-rich-media/audio/late-high_wails-long.ogg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/onja-org/html-exercises/56ba8f2ee6858bd9b172accafed7614033a41565/15-rich-media/audio/late-high_wails-long.ogg
--------------------------------------------------------------------------------
/15-rich-media/audio/late-high_wails.ogg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/onja-org/html-exercises/56ba8f2ee6858bd9b172accafed7614033a41565/15-rich-media/audio/late-high_wails.ogg
--------------------------------------------------------------------------------
/15-rich-media/audio/moan.ogg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/onja-org/html-exercises/56ba8f2ee6858bd9b172accafed7614033a41565/15-rich-media/audio/moan.ogg
--------------------------------------------------------------------------------
/15-rich-media/audio/purr.ogg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/onja-org/html-exercises/56ba8f2ee6858bd9b172accafed7614033a41565/15-rich-media/audio/purr.ogg
--------------------------------------------------------------------------------
/15-rich-media/caption/chip.vtt:
--------------------------------------------------------------------------------
1 | WEBVTT
2 |
3 | 00:00:00.000 --> 00:00:00.700
4 | Hey Chip!
5 |
6 | 00:00:00.700 --> 00:00:01.700
7 | Hey!
8 |
9 | 00:00:01.700 --> 00:00:02.500
10 | Hello Chip
11 |
12 | 00:00:02.500 --> 00:00:03.000
13 | Hello
14 |
--------------------------------------------------------------------------------
/15-rich-media/css/rich-media.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | }
4 |
5 | video {
6 | max-width: 25vw;
7 | max-height: 50vh;
8 | }
9 |
10 | canvas {
11 | width: 100vw;
12 | height: 30vw;
13 | cursor: pointer;
14 | }
15 |
16 | video,
17 | canvas {
18 | background-color: rgb(0,0,0);
19 | }
20 |
--------------------------------------------------------------------------------
/15-rich-media/index.md:
--------------------------------------------------------------------------------
1 | # HTML exercise 15: Rich media
2 |
3 | HTML5 brought some new elements that can help us display rich media, elements such as `audio`, `video` and even a `canvas` for drawing amazing 2D or 3D interactive environments.
4 |
5 | In this folder, you'll find a video, audio, and javascript file. Your job is to:
6 |
7 | - Have a `video` element with its controls load up and play the video file.
8 | - Have an `audio` element with its controls load up and play the audio file.
9 | - Load the JavaScript in the page using a `script` element,
10 | - Apply the CSS to the page using a `link` element, and lastly,
11 | - Provide a `canvas` element for the JavaScript to draw on.
12 |
13 | # Credits
14 |
15 | - All sounds from [Wikipedia](https://en.wikipedia.org/wiki/Ring-tailed_lemur_vocalizations)
16 | - Canvas Script from https://codepen.io/ge1doot/pen/LkdOwj
17 |
--------------------------------------------------------------------------------
/15-rich-media/js/canvas.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | // Example from: https://codepen.io/ge1doot/pen/LkdOwj
3 | ///////////////// worker thread code ///////////////////
4 | const theLastExperience = noWorkers => {
5 | "use strict";
6 | // ---- robot structure ----
7 | const struct = {
8 | points: [
9 | {
10 | x: 0,
11 | y: -4,
12 | f(s, d) {
13 | this.y -= 0.01 * s * ts;
14 | }
15 | },
16 | {
17 | x: 0,
18 | y: -16,
19 | f(s, d) {
20 | this.y -= 0.02 * s * d * ts;
21 | }
22 | },
23 | {
24 | x: 0,
25 | y: 12,
26 | f(s, d) {
27 | this.y += 0.02 * s * d * ts;
28 | }
29 | },
30 | { x: -12, y: 0 },
31 | { x: 12, y: 0 },
32 | {
33 | x: -3,
34 | y: 34,
35 | f(s, d) {
36 | if (d > 0) {
37 | this.x += 0.01 * s * ts;
38 | this.y -= 0.015 * s * ts;
39 | } else {
40 | this.y += 0.02 * s * ts;
41 | }
42 | }
43 | },
44 | {
45 | x: 3,
46 | y: 34,
47 | f(s, d) {
48 | if (d > 0) {
49 | this.y += 0.02 * s * ts;
50 | } else {
51 | this.x -= 0.01 * s * ts;
52 | this.y -= 0.015 * s * ts;
53 | }
54 | }
55 | },
56 | {
57 | x: -28,
58 | y: 0,
59 | f(s, d) {
60 | this.x += this.vx * 0.025 * ts;
61 | this.y -= 0.001 * s * ts;
62 | }
63 | },
64 | {
65 | x: 28,
66 | y: 0,
67 | f(s, d) {
68 | this.x += this.vx * 0.025 * ts;
69 | this.y -= 0.001 * s * ts;
70 | }
71 | },
72 | {
73 | x: -3,
74 | y: 64,
75 | f(s, d) {
76 | this.y += 0.015 * s * ts;
77 | if (d > 0) {
78 | this.y -= 0.01 * s * ts;
79 | } else {
80 | this.y += 0.05 * s * ts;
81 | }
82 | }
83 | },
84 | {
85 | x: 3,
86 | y: 64,
87 | f(s, d) {
88 | this.y += 0.015 * s * ts;
89 | if (d > 0) {
90 | this.y += 0.05 * s * ts;
91 | } else {
92 | this.y -= 0.01 * s * ts;
93 | }
94 | }
95 | }
96 | ],
97 | links: [
98 | { p0: 3, p1: 7, size: 12, lum: 0.5 },
99 | { p0: 1, p1: 3, size: 24, lum: 0.5 },
100 | { p0: 1, p1: 0, size: 60, lum: 0.5, disk: 1 },
101 | { p0: 5, p1: 9, size: 16, lum: 0.5 },
102 | { p0: 2, p1: 5, size: 32, lum: 0.5 },
103 | { p0: 1, p1: 2, size: 50, lum: 1 },
104 | { p0: 6, p1: 10, size: 16, lum: 1.5 },
105 | { p0: 2, p1: 6, size: 32, lum: 1.5 },
106 | { p0: 4, p1: 8, size: 12, lum: 1.5 },
107 | { p0: 1, p1: 4, size: 24, lum: 1.5 }
108 | ]
109 | };
110 | class Robot {
111 | constructor(color, light, size, x, y, struct) {
112 | this.x = x;
113 | this.points = [];
114 | this.links = [];
115 | this.frame = 0;
116 | this.dir = 1;
117 | this.size = size;
118 | this.color = Math.round(color);
119 | this.light = light;
120 | // ---- create points ----
121 | for (const p of struct.points) {
122 | this.points.push(new Robot.Point(size * p.x + x, size * p.y + y, p.f));
123 | }
124 | // ---- create links ----
125 | for (const link of struct.links) {
126 | const p0 = this.points[link.p0];
127 | const p1 = this.points[link.p1];
128 | const dx = p0.x - p1.x;
129 | const dy = p0.y - p1.y;
130 | this.links.push(
131 | new Robot.Link(
132 | this,
133 | p0,
134 | p1,
135 | Math.sqrt(dx * dx + dy * dy),
136 | link.size * size / 3,
137 | link.lum,
138 | link.force,
139 | link.disk
140 | )
141 | );
142 | }
143 | }
144 | update() {
145 | if (++this.frame % Math.round(20 / ts) === 0) this.dir = -this.dir;
146 | if (this === pointer.dancerDrag && this.size < 16 && this.frame > 600) {
147 | pointer.dancerDrag = null;
148 | dancers.push(
149 | new Robot(
150 | this.color + 90,
151 | this.light * 1.25,
152 | this.size * 2,
153 | pointer.x,
154 | pointer.y - 100 * this.size * 2,
155 | struct
156 | )
157 | );
158 | dancers.sort(function(d0, d1) {
159 | return d0.size - d1.size;
160 | });
161 | }
162 | // ---- update links ----
163 | for (const link of this.links) link.update();
164 | // ---- update points ----
165 | for (const point of this.points) point.update(this);
166 | // ---- ground ----
167 | for (const link of this.links) {
168 | const p1 = link.p1;
169 | if (p1.y > canvas.height * ground - link.size * 0.5) {
170 | p1.y = canvas.height * ground - link.size * 0.5;
171 | p1.x -= p1.vx;
172 | p1.vx = 0;
173 | p1.vy = 0;
174 | }
175 | }
176 | // ---- center position ----
177 | this.points[3].x += (this.x - this.points[3].x) * 0.001;
178 | }
179 | draw() {
180 | for (const link of this.links) {
181 | if (link.size) {
182 | const dx = link.p1.x - link.p0.x;
183 | const dy = link.p1.y - link.p0.y;
184 | const a = Math.atan2(dy, dx);
185 | // ---- shadow ----
186 | ctx.save();
187 | ctx.translate(link.p0.x + link.size * 0.25, link.p0.y + link.size * 0.25);
188 | ctx.rotate(a);
189 | ctx.drawImage(
190 | link.shadow,
191 | -link.size * 0.5,
192 | -link.size * 0.5
193 | );
194 | ctx.restore();
195 | // ---- stroke ----
196 | ctx.save();
197 | ctx.translate(link.p0.x, link.p0.y);
198 | ctx.rotate(a);
199 | ctx.drawImage(
200 | link.image,
201 | -link.size * 0.5,
202 | -link.size * 0.5
203 | );
204 | ctx.restore();
205 | }
206 | }
207 | }
208 | }
209 | Robot.Link = class Link {
210 | constructor(parent, p0, p1, dist, size, light, force, disk) {
211 | this.p0 = p0;
212 | this.p1 = p1;
213 | this.distance = dist;
214 | this.size = size;
215 | this.light = light || 1.0;
216 | this.force = force || 0.5;
217 | this.image = this.stroke(
218 | "hsl(" + parent.color + " ,30%, " + parent.light * this.light + "%)",
219 | true, disk, dist, size
220 | );
221 | this.shadow = this.stroke("rgba(0,0,0,0.5)", false, disk, dist, size);
222 | }
223 | update() {
224 | const p0 = this.p0;
225 | const p1 = this.p1;
226 | const dx = p1.x - p0.x;
227 | const dy = p1.y - p0.y;
228 | const dist = Math.sqrt(dx * dx + dy * dy);
229 | if (dist > 0.0) {
230 | const tw = p0.w + p1.w;
231 | const r1 = p1.w / tw;
232 | const r0 = p0.w / tw;
233 | const dz = (this.distance - dist) * this.force;
234 | const sx = dx / dist * dz;
235 | const sy = dy / dist * dz;
236 | p1.x += sx * r0;
237 | p1.y += sy * r0;
238 | p0.x -= sx * r1;
239 | p0.y -= sy * r1;
240 | }
241 | }
242 | stroke(color, axis, disk, dist, size) {
243 | let image;
244 | if (noWorkers) {
245 | image = document.createElement("canvas");
246 | image.width = dist + size;
247 | image.height = size;
248 | } else {
249 | image = new OffscreenCanvas(dist + size, size);
250 | }
251 | const ict = image.getContext("2d");
252 | ict.beginPath();
253 | ict.lineCap = "round";
254 | ict.lineWidth = size;
255 | ict.strokeStyle = color;
256 | if (disk) {
257 | ict.arc(size * 0.5 + dist, size * 0.5, size * 0.5, 0, 2 * Math.PI);
258 | ict.fillStyle = color;
259 | ict.fill();
260 | } else {
261 | ict.moveTo(size * 0.5, size * 0.5);
262 | ict.lineTo(size * 0.5 + dist, size * 0.5);
263 | ict.stroke();
264 | }
265 | if (axis) {
266 | const s = size / 10;
267 | ict.fillStyle = "#000";
268 | ict.fillRect(size * 0.5 - s, size * 0.5 - s, s * 2, s * 2);
269 | ict.fillRect(size * 0.5 - s + dist, size * 0.5 - s, s * 2, s * 2);
270 | }
271 | return image;
272 | }
273 | };
274 | Robot.Point = class Point {
275 | constructor(x, y, fn, w) {
276 | this.x = x;
277 | this.y = y;
278 | this.w = w || 0.5;
279 | this.fn = fn || null;
280 | this.px = x;
281 | this.py = y;
282 | this.vx = 0.0;
283 | this.vy = 0.0;
284 | }
285 | update(robot) {
286 | // ---- dragging ----
287 | if (robot === pointer.dancerDrag && this === pointer.pointDrag) {
288 | this.x += (pointer.x - this.x) * 0.1;
289 | this.y += (pointer.y - this.y) * 0.1;
290 | }
291 | // ---- dance ----
292 | if (robot !== pointer.dancerDrag) {
293 | this.fn && this.fn(16 * Math.sqrt(robot.size), robot.dir);
294 | }
295 | // ---- verlet integration ----
296 | this.vx = this.x - this.px;
297 | this.vy = this.y - this.py;
298 | this.px = this.x;
299 | this.py = this.y;
300 | this.vx *= 0.995;
301 | this.vy *= 0.995;
302 | this.x += this.vx;
303 | this.y += this.vy + 0.01 * ts;
304 | }
305 | };
306 | // ---- init ----
307 | const dancers = [];
308 | let ground = 1.0;
309 | let canvas = { width: 0, height: 0, resize: true };
310 | let ctx = null;
311 | let pointer = { x: 0, y: 0, dancerDrag: null, pointDrag: null };
312 | let ts = 1;
313 | let lastTime = 0;
314 | // ---- messages from the main thread ----
315 | const message = e => {
316 | switch (e.data.msg) {
317 | case "start":
318 | canvas.elem = e.data.elem;
319 | canvas.width = canvas.elem.width;
320 | canvas.height = canvas.elem.height;
321 | ctx = canvas.elem.getContext("2d");
322 | initRobots();
323 | requestAnimationFrame(run);
324 | break;
325 | case "resize":
326 | canvas.width = e.data.width;
327 | canvas.height = e.data.height;
328 | canvas.resize = true;
329 | break;
330 | case "pointerMove":
331 | pointer.x = e.data.x;
332 | pointer.y = e.data.y;
333 | break;
334 | case "pointerDown":
335 | pointer.x = e.data.x;
336 | pointer.y = e.data.y;
337 | for (const dancer of dancers) {
338 | for (const point of dancer.points) {
339 | const dx = pointer.x - point.x;
340 | const dy = pointer.y - point.y;
341 | const d = Math.sqrt(dx * dx + dy * dy);
342 | if (d < 60) {
343 | pointer.dancerDrag = dancer;
344 | pointer.pointDrag = point;
345 | dancer.frame = 0;
346 | }
347 | }
348 | }
349 | break;
350 | case "pointerUp":
351 | pointer.dancerDrag = null;
352 | break;
353 | }
354 | };
355 | // ---- resize screen ----
356 | const resize = () => {
357 | canvas.elem.width = canvas.width;
358 | canvas.elem.height = canvas.height;
359 | canvas.resize = false;
360 | ground = canvas.height > 500 ? 0.85 : 1.0;
361 | for (let i = 0; i < dancers.length; i++) {
362 | dancers[i].x = (i + 2) * canvas.width / 9;
363 | }
364 | }
365 | // ---- main loop ----
366 | const run = (time) => {
367 | requestAnimationFrame(run);
368 | if (canvas.resize === true) resize();
369 | // ---- adjust speed to screen freq ----
370 | if (lastTime !== 0) {
371 | const t = (time - lastTime) / 16;
372 | ts += (t - ts) * 0.1;
373 | if (ts > 1) ts = 1;
374 | }
375 | lastTime = time;
376 | // ---- clear screen ----
377 | ctx.clearRect(0, 0, canvas.width, canvas.height);
378 | ctx.fillStyle = "#222";
379 | ctx.fillRect(0, 0, canvas.width, canvas.height * 0.15);
380 | ctx.fillRect(0, canvas.height * 0.85, canvas.width, canvas.height * 0.15);
381 | // ---- animate robots ----
382 | for (const dancer of dancers) {
383 | dancer.update();
384 | dancer.draw();
385 | }
386 | };
387 | const initRobots = () => {
388 | // ---- instanciate robots ----
389 | ground = canvas.height > 500 ? 0.85 : 1.0;
390 | for (let i = 0; i < 6; i++) {
391 | dancers.push(
392 | new Robot(
393 | i * 360 / 7,
394 | 80,
395 | Math.sqrt(Math.min(canvas.width, canvas.height)) / 6,
396 | (i + 2) * canvas.width / 9,
397 | canvas.height * 0.5 - 100,
398 | struct
399 | )
400 | );
401 | }
402 | };
403 | // ---- main thread vs. worker
404 | if (noWorkers) {
405 | // ---- emulate postMessage interface ----
406 | return {
407 | postMessage(data) {
408 | message({ data: data });
409 | }
410 | };
411 | } else {
412 | // ---- worker messaging ----
413 | onmessage = message;
414 | }
415 | };
416 | ///////////////// main thread code ///////////////////
417 | let worker = null;
418 | const createWorker = fn => {
419 | const URL = window.URL || window.webkitURL;
420 | return new Worker(URL.createObjectURL(new Blob(["(" + fn + ")()"])));
421 | };
422 | // ---- init canvas ----
423 | const canvas = document.querySelector("canvas");
424 | canvas.width = canvas.offsetWidth;
425 | canvas.height = canvas.offsetHeight;
426 | // ---- instanciate worker ----
427 | if (window.Worker && window.OffscreenCanvas) {
428 | // instanciating background worker from a function
429 | worker = createWorker(theLastExperience);
430 | // cloning OffscreenCanvas
431 | const offscreen = canvas.transferControlToOffscreen();
432 | // sending data to worker
433 | worker.postMessage({ msg: "start", elem: offscreen }, [offscreen]);
434 | } else {
435 | // falling back execution to the main thread
436 | worker = theLastExperience(true);
437 | worker.postMessage({ msg: "start", elem: canvas });
438 | }
439 | // ---- resize event ----
440 | window.addEventListener(
441 | "resize",
442 | () => {
443 | worker.postMessage({
444 | msg: "resize",
445 | width: canvas.offsetWidth,
446 | height: canvas.offsetHeight
447 | });
448 | },
449 | false
450 | );
451 | // ---- pointer events ----
452 | const pointer = {
453 | x: 0,
454 | y: 0,
455 | down(e) {
456 | this.move(e);
457 | worker.postMessage({
458 | msg: "pointerDown",
459 | x: this.x,
460 | y: this.y
461 | });
462 | },
463 | up(e) {
464 | worker.postMessage({
465 | msg: "pointerUp"
466 | });
467 | },
468 | move(e) {
469 | if (e.targetTouches) {
470 | e.preventDefault();
471 | this.x = e.targetTouches[0].clientX;
472 | this.y = e.targetTouches[0].clientY;
473 | } else {
474 | this.x = e.clientX;
475 | this.y = e.clientY;
476 | }
477 | worker.postMessage({
478 | msg: "pointerMove",
479 | x: this.x,
480 | y: this.y
481 | });
482 | }
483 | };
484 | window.addEventListener("mousemove", e => pointer.move(e), false);
485 | canvas.addEventListener("touchmove", e => pointer.move(e), false);
486 | window.addEventListener("mousedown", e => pointer.down(e), false);
487 | window.addEventListener("touchstart", e => pointer.down(e), false);
488 | window.addEventListener("mouseup", e => pointer.up(e), false);
489 | window.addEventListener("touchend", e => pointer.up(e), false);
490 |
--------------------------------------------------------------------------------
/15-rich-media/video/chip.mp4:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/onja-org/html-exercises/56ba8f2ee6858bd9b172accafed7614033a41565/15-rich-media/video/chip.mp4
--------------------------------------------------------------------------------
/16-project-html/index.md:
--------------------------------------------------------------------------------
1 | # HTML exercise 16: Final Project
2 |
3 | You've learned a lot about HTML the past 3 weeks. Now it's time to share what you've learned. In this exercise, you need to create a website that can help others learn HTML.
4 |
5 | - [Sections](#sections)
6 | - [Pages](#pages)
7 | - [Getting started](#getting-started)
8 | - [What you'll be marked on](#what-youll-be-marked-on)
9 | - [Some hints](#some-hints)
10 |
11 | ## Sections
12 |
13 | The website will be broken up into the following sections:
14 |
15 | - Elements
16 | - Rules
17 | - Tips
18 |
19 | ## Pages
20 |
21 | We won't be creating all the possible pages in this website. Instead, we'll be building at least the following 6 example pages:
22 |
23 | - Homepage
24 | - List of all HTML rules
25 | - Nesting rules in detail
26 | - Attribute rules in detail
27 | - List of all the HTML5 elements
28 | - Tips for writing HTML
29 |
30 | ### The homepage
31 |
32 | The homepage needs to:
33 |
34 | - introduce the website to the user, explaining what the website is about
35 | - have a brief description of HTML
36 | - offer links to the various sections.
37 | - finish off with your details as the author. How do people know who wrote this website? How can they get in touch with you?
38 |
39 | ### List of HTML rules page
40 |
41 | There are many rules for coding or writing HTML. Try to list as many as you can, one sentence per rule.
42 |
43 | Two of the rules need to be links to their own pages:
44 |
45 | - The nesting rules
46 | - The attribute rules
47 |
48 | #### Nesting rules page
49 |
50 | In this page, you'll need:
51 |
52 | - a link back to the list of rules
53 | - a heading, giving this rule a title
54 | - a description of this rule
55 | - a "Don't do this!" code example of nesting
56 | - a "Do this instead" code example of nesting
57 |
58 | #### Attribute rules page
59 |
60 | In this page, you'll need:
61 |
62 | - a link back to the list of rules
63 | - a heading, giving this rule a title
64 | - a description of this rule
65 | - a "Don't do this!" code example of using attributes
66 | - a "Do this instead" code example of using attributes
67 |
68 | ### List of all elements page
69 |
70 | In this page, we need:
71 |
72 | - a good title
73 | - a definition of an HTML 'element' and what bits make up an 'element'
74 | - a list of all HTML5 elements by element name
75 |
76 | ### Tips for writing HTML page
77 |
78 | This page is a chance to get personal. Give your reader at least 3 tips on how to write HTML. Think:
79 |
80 | - How to write HTML quicker
81 | - What tools to use
82 | - How to make sure your work is high-quality
83 |
84 | ## Getting started
85 |
86 | 1. Create a public repo called: `learning-html`, and add a `README.md`
87 | 1. Copy and clone the SSH URL for this new repo in a directory on your computer, preferably in `~/code/html`.
88 | 1. Create and push the `gh-pages` branch, and enable 'GitHub Pages' on that branch in the repo settings.
89 | 1. Add the URL for this website to the `README.md` file
90 | 1. Use `master` as your default development branch, only merging to `gh-pages` when you're ready to publish your changes.
91 | 1. Get coding!
92 |
93 | ## What you'll be marked on
94 |
95 | Your project will be evaluated on:
96 |
97 | - Your use of English (Spelling, Grammar)
98 | - Your code cleanliness (Is it easy to read, and free of garbage?)
99 | - Your use of HTML elements (Did you use the correct HTML element? Could you have used an HTML element where there is none?)
100 | - Your Git commits, pushes, branch use.
101 |
102 | You could also lose points if there are any:
103 |
104 | - 404s for any of your links
105 | - validation **errors** in the W3C validator. Warnings are OK.
106 |
107 | ## Some hints
108 |
109 | - Try to be consistent
110 | - Keep your HTML clean and easy to read
111 | - Spell-check and proof-read your English
112 | - Validate and test your work
113 | - Do your URLs make structural and meaningful sense?
114 | - Does your `README.md` contain details on how to develop and publish this website?
115 | - Do you link to your own pages if you have a matching page for the subject you're talking about?
116 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # HTML exercises
2 |
3 | In this repo, we have created a series of HTML exercises.
4 |
5 | ## Getting started
6 |
7 | 1. Fork this repo to your own account, by clicking the `Fork` button in the top right. 
8 | 1. Then clone your forked repo. **Important**: Make sure you clone your own repo, not this original repo.
9 | 1. Make your changes, as the exercises demand.
10 |
11 | ## Exercises
12 |
13 | - [01: HTML syntax rules](01-rules/index.md)
14 | - [02: Tables](02-tables/index.md)
15 | - [03: Nested lists](03-nested-lists/index.md)
16 | - [04: Sectioning elements](04-sectioning-elements/index.md)
17 | - [05: All elements](05-all-elements/index.md)
18 | - [06: Images](06-images/index.md)
19 | - [07: Weekend: Blog](07-weekend-blog/index.md)
20 | - [08: Log in form](08-log-in-form/index.md)
21 | - [09: Choosing the correct field](09-correct-fields/index.md)
22 | - [10: Form to Google Sheets](10-form-to-sheets/index.md)
23 | - [11: Inline markup](11-inline-markup/index.md)
24 | - [12: Clean code](12-clean-code/index.md)
25 | - [13: Semantics](13-semantics/index.md)
26 | - [14: Weekend: Blog design](14-blog-design/index.md)
27 | - [15: Rich media](15-rich-media/index.md)
28 | - [16: Project: Learning HTML](16-project-html/index.md)
29 |
30 |
--------------------------------------------------------------------------------
/fork-button.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/onja-org/html-exercises/56ba8f2ee6858bd9b172accafed7614033a41565/fork-button.png
--------------------------------------------------------------------------------
/template.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
16 |
17 |
18 |
19 |
22 |
23 |
24 |
--------------------------------------------------------------------------------