HTML Tutorials
HTML Tutorials
HTML Tutorials
Section Page
The Basics.........................................................................................................................................1
What the HTML tags mean.....................................................................................................2
Exercise 2 – Changing the background colour...............................................................3
Exercise 3 – Different sizes of text.....................................................................................3
Exercise 4 – Changing font style & colour.......................................................................4
Exercise 5 – Text attributes & alignment.........................................................................5
Exercise 6 – Adding an image..............................................................................................5
Exercise 7 – Linking to a website........................................................................................6
Exercise 8 – Adding a horizontal line.................................................................................6
Exercise 9 – Lists.......................................................................................................................7
Exercise 10 – Using a background image........................................................................7
Exercise 11 – Adding an e-mail address link..................................................................8
Exercise 12 – Linking to another web page....................................................................8
Exercise 13 – Tables.................................................................................................................8
Exercise 14 – Adding menu areas.....................................................................................10
The Basics
HTML stands for Hyper Text Mark-up Language, and is the basic code
behind web pages.
In Internet Explorer load your favourite web page. Right click somewhere
on the page, select View Source, you will now see the HTML code behind
the page displayed.
You will be using software called Notepad++ to write your HTML.
An HTML file is just a page of text with lines of code set in tags. The tags
are set in angled brackets < and >.
The tags tell the browser how to display the contents of the page.
Most tags come in pairs i.e. an opening and a closing tag
For example
One tag which does not need a closing tag is the <BR> tag, which is used
to force or break the text onto the next line. It’s the HTML equivalent of
hitting the Enter key on your keyboard when you type words in Microsoft
Word.
If you’d like more help with the tags then you can go to
http://www.w3schools.com/html/default.asp for details of all the tags and
their attributes.
<HTML>
<HEAD>
<TITLE>Basic</TITLE>
</HEAD>
<BODY>
My name is xxx
</BODY>
</HTML>
<HTML>
<HEAD>
<TITLE>Background</TITLE>
</HEAD>
<BODY STYLE="BACKGROUND-COLOR:YELLOW;">
<P>My last page was dull</P>
<P>This one has a background colour!</P>
</BODY>
</HTML>
The <P> tag is called the paragraph tag and anything typed between the
opening <P> and closing </P> tags will display as a paragraph.
Note ‘color’ is spelt in the American way
Save your work again (Ctrl-S)
Open your HTML folder
Open the background.htm file to see it displayed as a web page in Internet
Explorer. It should look something like …
Save your work then open it in Internet Explorer to view your page. It
should look like this …
Save your work then open it in Internet Explorer to view your page.
Save your work again then open it in Internet Explorer to view your page.
Return to the Notepad file. You are now going to make some changes to the
text
Note that the word “center” is spelled in the American way.
The word “amazing” need to be in bold. Use the tags <B> & </B>
The word “impressed” needs to be underlined. Use the <U> tag, remember
to add the closing tag.
Save your work again then open its Internet Explorer window, click Refresh,
and view the changes to your page.
<HTML>
<HEAD>
<TITLE>Image</TITLE>
</HEAD>
<BODY>
<BODY STYLE="BACKGROUND-COLOR:AQUA;">
<H1>This web page has a blue background</H1>
<H2>It displays an image</H2>
<IMG SRC="simpsonsfamily.png"> </IMG>
</HTML>
Save your work again then open it in Internet Explorer to view your page.
Test your hyperlink.
Note that you have to put some text to act as the link. In the example the
text ‘To the news!’ will be in blue & underlined to show it’s a hyperlink. This
text goes after the opening <A HREF…> tag, and before the closing </A>.
Save your work again then open it in Internet Explorer to view your page.
HTML tutorials Page 6 of 10
Exercise 9 – Lists
You are going to create a numbered list and a bullet-point list
Open Notepad ++
Save this file as lists.htm in your HTML folder.
Type in the HTML tags below:
Save your work again then open it in Internet Explorer to view your page.
You should have noticed that the tag <BR/> gives one line space down,
whereas <P></P> is for whole paragraphs.
Save the file again. Then open its Internet Explorer window, click Refresh,
and view the changes to your page.
Save your work again then open it in Internet Explorer to view your page.
Save your work again then open it in Internet Explorer to view your page.
Click on the e-mail link and see what happens!
As with the website link, you have to put some text to act as the link. In
the example the text ‘Send me an e-mail now!’ will be in blue & underlined
to show it’s a link. As before, this text goes after the opening <A HREF…>
tag, and before the closing </A>.
Save your work again then open it in Internet Explorer to view your page.
Click On the hyperlink to test whether it goes to your BBC link page.
Can you now set up a link on your BBC page (“website.htm”) to return to
the page you have just created (“pagelink.htm”)?
Exercise 13 – Tables
Tables allow text and pictures to be arranged in columns and rows. You can
arrange items horizontally across the page, instead of all items following below
each other. This also means you can include images alongside the text. The
tag to insert a basic table is <TABLE>
Open Notepad++
Save this file as table1.htm in your HTML folder.
Type in the HTML tags below:
This creates a table with 2 rows & 2 columns, making 4 cells in total.
Save your work again then open it in Internet Explorer to view your page.
Here is another table example that you can try. Save it as table2.htm
This includes colour borders around the cells
Save your work again then open it in Internet Explorer to view your new
table. It should look something like this:
Experiment with the layout. Can you put the menu on the left, and change
the page colour?