Escolar Documentos
Profissional Documentos
Cultura Documentos
HTML, or Hypertext Markup Language, is the language used to write Web pages.
Important: HTML files must always be saved in plain text format, not as word processor files—in
other words, alphanumeric characters only (no formatting of any kind). Don’t use a word processor to
create your file HTML, since you might accidentally save it in the wrong format. Use a text editor like
Notepad instead, since it can only save files as plain text.
<HTML>
• Use Notepad to create a text file as illustrated. <HEAD>
• Save it as webpage.html <TITLE>
To prevent Notepad from adding the extension .txt onto the My First HTML
filename (e.g. myfile.html.txt), be sure that the Save As Type field Document is
set to All Files, not Text Documents. </TITLE>
</HEAD>
<BODY>
Sale
<I>
Tuesday
</I>
You have just created a complete, although a very simple, HTML !
document. </BODY>
</HTML>
Now check to see what it would look like on the Internet by running a Web
browser and loading webpage.html. On the TDSB system, you might have to load the page by finding
it on your home drive, right-clicking on it, selecting Open With, then selecting Internet Explorer.
HTML is called a markup language because it takes ordinary text, such as the words "Sale
Tuesday!" and marks it up with tags. HTML tags are placed between < > angled brackets.
Most HTML tags work in pairs, consisting of an opening tag and a closing tag. Notice the pairs
<HTML> and </HTML>, <HEAD> and </HEAD>, <TITLE> and </TITLE>, and so on. The tag <I> tells
the Web browser to begin displaying the text which follows in italic letters, while the tag </I> tells the
Web browser to stop displaying italics.
Note: HTML should not be called a programming language. Computer programming languages,
such as BASIC, Pascal, Turing, C, and Java, are quite different from markup languages like HTML.
Page 2 of 13
INTERNET WEB PAGE DESIGN
Page 3 of 13
INTERNET WEB PAGE DESIGN
Text Flow
When you view your file in a browser, notice how the text flows from one side of the screen
to the other with no regard for any paragraphing or line spacing you used in your source file.
In HTML you must use tags to indicate line breaks and paragraph breaks. For example:
<BR> Line break
<P> Paragraph break </P>
A section break can be indicated by drawing a horizontal line across the screen with
<HR> Hard rule
Notice that the tags <BR> and <HR> are quite unusual for HTML because they are not used in pairs.
• Format the text you added about yourself using the HTML text formatting tags to
create paragraph breaks, etc.
• Save the file.
Font Size
Font size is controlled in two main ways. The first is with tags for headings, the largest being
<H1> and the smallest <H6>. They are:
<H1> </H1>, <H2> </H2>, <H3> </H3>, <H4> </H4>, <H5> </H5>, and <H6> </H6>
• Experiment with various sections of your text to see the effect of several of the
heading tags:
Example: <H3> Text goes here </H3>
Note: Heading tags such as <H1>, <H2>, <H3>, etc.create a blank line above and a
blank line below the heading.
What if you don’t want blank lines setting off your text? The second way to control font size
is with the <FONT> tag.
Example: <FONT SIZE=“1”> Text goes here </FONT>.
After the equal sign, use any number between 1 and 6.
The <FONT> tag can also be used to increase or decrease the size of text in comparison to
the text that precedes it.
Example: <FONT SIZE=“4”> Text goes here </FONT>
<FONT SIZE=“-1”> Text goes here </FONT>
<FONT SIZE=“-1”> Text goes here </FONT>
• Add headings to your text, using at least two <H> tag pairs.
Page 5 of 13
INTERNET WEB PAGE DESIGN
Font Styles
HTML also provides the following tags for font styles:
Bold <B> Text goes here </B>
Underline <U> Text goes here </U>
Font Colour
The <FONT> tag can control the colour of text:
Example: <FONT COLOR="RED">Text goes here</FONT>
<FONT COLOR="BLUE">Text goes here</FONT>
• At the top of your text, add the word Jarvis in Font Size 2.
• Centre it on the line.
• Follow it with a Hard Rule <HR>.
• Make the letter J red and the remaining letters of the word blue.
• Save the file.
Later you will learn more about font colours, as well as background colours.
Notes on HTML
• HTML tags may be written in capitals letters or lower-case. While many people use
capital letters to make their code easier to read, the trend now is to use lower-case letters.
• Tags containing COLOR, CENTER and GRAY use American spelling.
• It does not matter how many spaces you use in HTML. Multiple spaces in your HTML
file are always displayed in the browser as just ONE space.
• To force multiple consecutive spaces, use the non-breaking space character
• The browser makes text flow without any line breaks or paragraph breaks unless you
specifically instruct it with <BR> and <P>.
• There is no HTML tag for indent. The non-breaking space character ( ) can be
used for this effect.
Remember, text will not display in the browser as you see it in your word processor. You
must do all text formatting with HTML tags, mostly with <BR> and <P>.
Page 6 of 13
INTERNET WEB PAGE DESIGN
Ex. 3. Hyperlinks
The word hypertext means that you can click on a word (or image) in order to receive
additional information. Hyperlinks are very easy to create. On the last line of your file add
the following text:
Follow this link to Yahoo.
• Turn the word “Yahoo” into a hyperlink by making the following changes:
Follow this link to <A HREF=”http://www.yahoo.com”>Yahoo</A>.
• View the page in your browser and test to see if the hyperlink works.
• Below the Yahoo hyperlink, add a sentence containing a hyperlink to a Web site of
your choice. Save the file.
Ex. 4. Graphics
Inserting a Graphic
Usually a Web page includes one or more graphic images. Be sure there is a graphic image
on your home drive in the same folder as your HTML file. (You can find a fun image at
schools.tdsb.on.ca/jarvisci/gfx/aendk.jpg).
• Let us imagine that your image is called filename.jpg. Make it appear directly above
the coloured title “Jarvis” as follows:
<IMG SRC=”filename.jpg”>
• Notice whether the default is centred, left-aligned or right-aligned.
• Save the file.
Of course, red is not the only colour you can use. There are many: RED, GREEN, BLUE,
BLACK, WHITE, YELLOW, GRAY; and less common shades: SILVER, LIME, TEAL,
OLIVE, MAROON, PURPLE, AQUA, NAVY and FUCHSIA.
• Choose a colour you like from the words above and set it as the background colour.
• Save the file.
Let’s consider colours for fonts first. The HTML tag to set an RGB font colour looks like
this:
<FONT COLOR=#CC66FF>Text goes here</FONT>
In <FONT COLOR=#CC66FF> the first two characters (CC) represent how much red will
go into the final colour, the second pair (66) represents how much green will go into the final
colour and the third pair (FF) represents how much blue will go into the final colour.
You can combine more than one attribute in the <BODY> tag:
Example: <BODY BGCOLOR=#0000FF TEXT=#FFFFFF LINK=#00FF00
VLINK=#FF0000>
Students who wish to experiment with colours using the hexadecimal system can find useful
guides to colours and their hexadecimal codes on the Internet at sites such as:
• http://www.phoenix.net/~jacobson/pages/rgbhex.html
• http://www.zspc.com/color/index-e.html
• http://www.december.com/html/spec/color.html
• http://zorba.uafadm.alaska.edu/Library/impact/hexdec216.html
Page 10 of 13
INTERNET WEB PAGE DESIGN
Background Images
The <BODY> tag allows you not only to set a background colour but also to use an image as
the background of your document:
Example: <BODY BACKGROUND=”filename.jpg”>
The image must be chosen very carefully so that it does not make other parts of the page
difficult to read. It will be repeated or tiled to fill the background to the entire page.
Font Size
Starting an HTML File <H1> … <H6>
<HTML> <FONT SIZE=“1”> </FONT>
<HEAD> <FONT SIZE=“+1”> </FONT>
<TITLE> <FONT SIZE=“-1”> </FONT>
<BODY>
Font Styles
<B>
Closing an HTML File <U>
</BODY>
</HTML>
Colour Words
Text Formatting RED, GREEN, BLUE, BLACK, WHITE,
<BR> YELLOW, GRAY, SILVER, LIME, TEAL,
<P> OLIVE, MAROON, PURPLE, AQUA,
<HR> NAVY, FUCHSIA.
<CENTER>
<BLOCKQUOTE> Font Colour
<FONT COLOR=”RED”> </FONT>
<FONT COLOR=#FF0000> </FONT>
Lists
<UL> … <LI> Body Attributes
<OL> … <LI> <BODY BGCOLOR=#0000FF>
<BODY TEXT=#FFFFFF>
Hyperlinks <BODY LINK=#00FF00>
<A HREF=”http://www.yahoo.com”> </A> <BODY VLINK=#FF0000>
Graphics
<IMG SRC=”graphic.jpg”>
<IMG SRC=”graphic.jpg” ALIGN=”LEFT”>
<IMG SRC=”graphic.jpg” ALIGN=”MIDDLE”>
<IMG SRC=”graphic.jpg” ALIGN=”TOP”>
<IMG SRC=”graphic.jpg” ALIGN=”MIDDLE”>
<IMG SRC=”graphic.jpg” ALIGN=”BOTTOM”>
Page 13 of 13
INTERNET WEB PAGE DESIGN
Create a personal Web page for yourself, expressing your interests, hobbies, favourite
entertainers, school, family—anything you want people to know about you.
The first items on your Web page must be your name, the name of this course, the name of
your teacher, and the period of your class.
Your HTML file should include at least one example of each of the following tags:
1. <BODY BGCOLOR>
2. <H1> or other Heading tags
3. <BR>
4. <P>
5. <HR>
6. <UL> or <OL>
7. <FONT COLOR=>
8. <FONT SIZE=>
9. <IMG SRC>
10. <IMG ALIGN=“RIGHT”>
11. <IMG ALIGN=“”MIDDLE”>
12. <CENTER>
13. <A HREF=>
Note: This assignment must be done especially for this course. Do not copy a page that you
might have already created outside class.
Enrichment
Students who finish the assignment early should learn more advanced HTML by visiting the
following Web site:
http://www.mcli.dist.maricopa.edu/tut/
Page 14 of 13
INTERNET WEB PAGE DESIGN
When your browser first loads, why let it load the Yahoo home page, or MSN or any other
commercial Web page? Instead, create your own page in HTML with only your favourite
links conveniently arranged, and make that the default. Not only is it useful, but it loads
instantly since it is kept on your hard disk and does not depend on a connection to the
Internet. Below is a very simple example.
The code creates a non-breaking space, enabling you to create 2 or more
spaces in a row.
<HTML>
<HEAD>
<TITLE>Default Page</TITLE>
</HEAD>
<BODY>
<CENTER>
<H3>
<A HREF="http://www.google.com">Google</A>
<A HREF="http://groups.google.com">Google groups</A>
<P>
<A HREF="http://www.theglobeandmail.com">The Globe and Mail</A>
<A HREF="http://www.nationalpost.com">The National Post</A>
<A HREF="http://www.thestar.com">TorontoStar</A>
</P>
<P>
<A HREF="http://schools.tdsb.on.ca/jarvisci">Jarvis Web site (TDSB)</A>
</P>
<P>
<A HREF="http://mail.yahoo.com/">Yahoo mail </A>
<A HREF="http://www.hotmail.com">Hotmail </A>
</P>
</H3>
</CENTER>
</BODY>
</HTML>
Page 15 of 13
INTERNET WEB PAGE DESIGN
Additional Resources
http://www.w3schools.com/html/default.asp
A very good online tutorial in HTML, teaching the skills step by step. Includes “live”
practice, where you type HTML into an area on the screen and see the results in a
second area. More than the basics—tables, frames and forms
http://www.webmonkey.com/webmonkey/reference/html_cheatsheet/
Quick reference for HTML tags.
http://www.w3schools.com/css/css_intro.asp
Good Cascading Style Sheets (CSS) tutorial.
http://www.echoecho.com/css.htm
Another good CSS tutorial.
http://www.htmlhelp.com/reference/css/quick-tutorial.html
Quick tutorial on CSS.
http://www.w3.org/
Word Wide Web Consortium (W3C). The official source of standards for the World
Wide Web, the final word on HTML, XHTML, CSS, etc.