1. Click here for instructions on how to get the iframe code for a
YouTube video.
2. Follow the instructions to add a video on page1.html.
3. Set the width attribute of the iframe to: 280
4. Set the height to a value between: 150 and 220
5. Use <h3> tags to add a heading above the video.
3.5. review
Your page2.html should be about a topic that relates to page1.html. In our
example, page 1 is about the game Mario Bros, and page 2 is about the
character Mario.
Now you'll gather the content for page2.html. Refer to page1.html or the
reference guide to remind you of what you have learned so far.
Complete the following for page2.html:
1. Add a <h1> heading with the title of your page.
2. Add 2 or more paragraphs <p> of text.
3. Add an image from Wikipedia.
4. Add the Wiki logo to the top of the page above the heading. The
image path is: /images/wiki-jr.png
5. Add the Code Avengers logo to the bottom of the page. The image
path is: /images/ca-logo.png
6. (Optional) Add <h2> subheadings above each paragraph.
7. (Optional) Add a description above the image using <h3> tags.
8. (Optional) Use the width attribute to make sure that the images fit
the page nicely.
4. Anchors
4.1. anchor to another website
Wikipedia articles contain blue words that you can click on to jump to
related articles. These links between articles are created with anchor tags
<a>.
Our page1.html uses an <a> tag to link the word "Nintendo" to it's
Wikipedia page. Here's the code: <a
href="http://en.wikipedia.org/wiki/Nintendo"> Nintendo </a>
The anchor tag's href attribute gives the address that your web browser
opens when the anchor text is clicked.
Complete the following on page1.html:
1. On the line after the Wiki Jr logo, insert the following code:
Insert <a href="">Wikipedia</a>
2. Set the href attribute to link to the Wikipedia page about your
topic.
3. (Optional) Link a word in one of your paragraphs to the Wikipedia
page about that topic.
4. Click when you are done
4.2. anchor to pages in the same folder
Anchors to web pages on different websites need the href set to a full
webpage address, such as: http://wikipedia.org/wiki/Mario
However, links between pages in the same folder on the same website just
need the filename.
For example, page1.html can link to page2.html using the following code: <a
href="page2.html">NAME_OF_TOPIC</a>
On page1.html:
1. On the line after the Wikipedia link, add the following anchor tag
code, and change the text to the name of your 2
nd
page: Insert
<a>NAME_OF_TOPIC</a>
2. Link the anchor to page2.html using the following code: Insert
href="page2.html"
3. (Optional) On page1.html link a suitable word or phrase in your
text to your page2.html. E.g. <p>In the game, <a
href="page2.html">Mario</a>...
4.3. anchor to pages in the same folder
When you link to web pages in different folders on the same website, the
href value starts with / followed by the folder and file name.
The following code links to our Wiki Jr index page: Insert <a
href="/wiki/index.html"> Index </a>
On page1.html, add the following:
1. Just before the Wikipedia page link, add a link to the Wiki Jr index
page with the link text: "Index"
2. Put vertical bars | between the links to the Index, Wikipedia, and
page2.html.
The | character is above the ENTER key on US keyboards, or in the bottom
left on UK keyboards.
4.4. anchor to home page
To link to your website's homepage, you can use: Insert <a
href="/">Homepage</a>
Complete the following on page1.html:
1. At the bottom, add <a> </a> tags around the text "Powered
by Code Avengers" at the bottom of the page.
2. Link the text to the Code Avengers' home page using: href="/"
4.5. anchor review
Let's do a quick review of the 4 types of links in this lesson.
1. Links to pages on other websites use the full URL. Insert <a
href="http://wikipedia.org"> Wikipedia </a>
2. Links to pages in the same folder use the file name only.
Insert <a href="page2.html"> Mario </a>
3. Links to pages in a different folder start with / followed by the
folder and file path. Insert <a href="/wiki/index.html">
Index </a>
4. To link to a website home page set href to /. Insert <a
href="/"> Homepage </a>
Click here for more information about the types of links.
For this task you'll add links to page2.html.
1. Under the Wiki Jr logo on page2.html, add a link to the Wiki Jr index
page.
2. Next to the index link, add a link to the Wikipedia page about your
page2.html topic.
3. Next to the Wikipedia link on [page2.html]], add a link to
page1.html.
4. At the bottom of page2.html, add the text "Powered by Code
Avengers" and link it to the Code Avengers home page.
5. Click when you are done.
5. Intro to CSS