What is expected of you, the student, is that by the time you finish with this course you will have a basic understanding of HTML and will be able to create a basic webpage that people could go to and view if they wanted to. After reading through the course notes you should be able to adequately show what you have learned.
Important: While you can use visual editors like Frontpage or Composer to write HTML, these won't help you if you want to add PHP or ASP to your pages. In that case, you will have to understand and be able to use HTML source code. The exam questions in this course are written for students doing a direct source code edit. Please do not use a visual editor while doing the exam; it is obvious if you do, and you will be penalized some points for doing so.
Another note: In this course, we always show code examples in a blue and output in red.We strongly recommend that you use Notepad or other plain text editor (such as Notepad++) for writing HTML source code. First, it automatically saves files as the correct text-only structure (not in a document structure like Word or Wordpad) and secondly, it allows you to nicely structure code because of the fixed-width font. Most HTML editing software also possesses a source code editing mode you can use.
Warning: While Microsoft Word can be used as an HTML editor, it is not recommended that you use it. It has a bad tendency to add things to your html file and change tags around. Especially opening a pre-existing HTML in Word, editing it and saving it back can completely destroy the structure of your page. You have been warned. When you are working with Notepad or other plain text editors like it, make sure to save you files as .html or .htm. Either of the two will work, but .html is recommended for saving your files.
One of the things that can screw up a page easier then any other thing is that one of the tags was not closed out properly. A closing tag looks like </HTML>. Most tags require that they be closed out to work properly. All you do to close out a tag is add / before the text of the tag and the after . So to close the <BODY> tag, you would type </BODY>
Another note within this course you will see all tags in upper case. Tags can either be in upper or lower case, it does not matter. All of the following are acceptable examples of the <BODY> tag: <Body>,<body>,<bOdY> etc. (However, the W3C's XHTML specifications state that all tags and elements must be defined in lowercase.)
Now, we move on to talking about the individual tags.
<HTML>
Text and tags for webpage
</HTML>
Remember, every page must open with an <HTML> tag and close with the corresponding </HTML>.
The next two tags you will need are <HEAD> and <TITLE>. The <HEAD> tag is used to define the header of the page. The header contains basic settings, for now the only thing relevant is that this is the location that the <TITLE> tag goes in. The <TITLE> tag is the tag that is used to make the title of the page, in Internet Explorer or Mozilla that is the text that appears in the little blue bar at the top of the window. An example of what these tags will do and how to place them:
<HTML>
<HEAD>
<TITLE>
A great HTML
page
</TITLE>
</HEAD>
Rest of HTML document.
</HTML>
This will show in your browser as:

<HTML>
<HEAD>
<TITLE>
An HTML page with body
</TITLE>
</HEAD>
<BODY>
The body of the HTML document.
</BODY>
</HTML>
This is a simple example, but there is more to this tag, because it can control the general color schema of a page. Through the body tag, you can set the background color, the text color, and three link colors (active links, visited links, and unvisited links).
To do this, you will need to add attributes to the tag. An attribute is written as name="value"; for example, text="white".
- bgcolor = a background color for the page
- background = a background image for the page (this will be explained later)
- text = the page text color
- link = the color for unvisited links on the page
- vlink = the color for visited links on the page
- alink = the color for active (just being clicked on) links on the page
And now for a more complex example of the <BODY> tag using all these:
<HTML>
<HEAD>
<TITLE>
An HTML page with a colorful body
</TITLE>
</HEAD>
<BODY BGCOLOR="black" TEXT="white" LINK="green" VLINK="red"
ALINK="#FFFF00">
The body of the HTML document.
</BODY>
</HTML>
This next group of tags are the text formatting tags. The first of which is the <FONT> tag. This tag is used mostly for changing font size of the text or for changing the font color. It is best that this tag only be used to change the text for certain areas or phrases and not the whole document. An example is as follows:
<HTML>
<HEAD>
<TITLE>
A complete HTML page with some markup
</TITLE>
</HEAD>
<BODY>
<FONT COLOR="#808080">
This is grey text.
</FONT>
<FONT SIZE="+2">
And this is very large red text.
</FONT>
</BODY>
</HTML>
This is grey text. And this is very large red text.
Notice: You will have seen that the example code is always indented. While this is not required, it makes for good legibility. You will always see which tags are closed where. The style shown is a good start - you can vary yours. Also, multiple spaces show in a page as just one space, so don't feel afraid to use liberal spacing in your source code if it's easier to read.
The next group of tags that we will discuss are the <B>, <I>, and <U> tags. These tags are really easy to use and understand. The <B> tag is bold,<I> is italics, and <U> is underline.
Notice: An alternative for <B> is <STRONG> and an alternative for <I> is <EM>.
An example of their use:
<HTML>
<HEAD>
<TITLE>
Hello World!
</TITLE>
</HEAD>
<BODY>
Hello World, <B>bold</B>,
<I>italic</I> and <U>underlined</U> text help emphasize things.
</BODY>
</HTML>
Hello World, bold, italic and underlined text help emphasize things.
Notice: Make sure to remember to close your tags, otherwise everything after the tags will receive the emphasis.
The next few tags that are going to be covered are formatting tags, but are generally used for larger sections of text, not just a few words here and there. The first of these is the <CENTER> tag. This tag is self-explanatory: Put the text you want centered between the tags: <CENTER> Text </CENTER>. The next tag is the <BR> tag. This tag insets a break line into the document. The next one is the <HR> tag. This tag puts a horizontal rule into the document.
Notice: Neither the <BR> and <HR> tags have a closing tag, instead they can be "self-closing"; either is correct: <BR> and <BR />.
Example all these tags:
<HTML>
<HEAD>
<TITLE>
Look mum,
more tags!
</TITLE>
</HEAD>
<BODY>
This is a normal paragraph of
text.<BR>
Now this text is on a new line.<BR>
<HR>
<CENTER>
This line of
text is centered, between two horizontal rules.
</CENTER>
<HR>
<BR><BR>
And this final line is set apart from
the rest of the page by several line breaks.
</BODY>
</HTML>
This is a normal paragraph of text.
Now this text is on a new line.
And this final line is set apart from the rest of the page by several line breaks.
- Just a filename (htmlnotes8.html): Links to a file in the same directory
- A directory and filename (/dbjedi/shadowacademy/sa/htmlnotes1.html): Links to a file in a different directory on the same server.
- A full URL like it would show in your browser address bar (http://www.darkjedibrotherhood.com/dbjedi/news.asp): Links to a page on a different site.
<HTML>
<HEAD>
<TITLE>
Link examples
</TITLE>
</HEAD>
<BODY>
Go to the <A HREF="KharShian_HTML.php">next
page</a> in this course.<BR>
Or <A HREF="/dbjedi/shadowacademy/sa/KharShian_HTML.php">read
it again</a> from the beginning.<BR>
Or, you could just go check <A HREF="http://www.darkjedibrotherhood.com/news.asp">Dark
Jedi Brotherhood News</A>.
</BODY>
</HTML>
Go to the Advanced HTML course notes.
Or go to the topof this page.
Or, you could just go check Dark Jedi Brotherhood News.
_blank.
<A HREF="http://www.starwars.com" TARGET="_blank">Official Star Wars Page</A>
<IMG SRC="KharShian_HTML_Head.jpg" width="193" height="63">
<IMG SRC="KharShian_HTML_Head.jpg" WIDTH="386" HEIGHT="126">
<IMG SRC="KharShian_HTML_Head.jpg" WIDTH="200" HEIGHT="200">
<HTML>
<HEAD>
<TITLE>
Some Shadow
Academy Staff
</TITLE>
</HEAD>
<BODY>
<TABLE>
<TR>
<TH>Position</TH>
<TH>Rank</TH>
<TH>Name</TH>
</TR>
<TR>
<TD>Headmaster</TD>
<TD>Dark Side Adept</TD>
<TD>Anshar Kahn Tarentae</TD>
</TR>
<TR>
<TD>Praetor</TD>
<TD>Sith Warlord</TD>
<TD>Dacien Victae di Plagia</TD>
</TR>
<TR>
<TD>Eclectic Pedagog</TD>
<TD>Jedi Hunter</TD>
<TD>Made Up Name</TD>
</TR>
</TABLE>
</BODY>
</HTML>
The resulting table looks as follows:
| Position | Rank | Name |
|---|---|---|
| Headmaster | Dark Side Adept | Anshar Kahn Tarentae |
| Praetor | Sith Warlord | Dacien Victae di Plagia |
| Eclectic Pedagog | Jedi Hunter | Made Up Name |
An Unordered list simply uses bullets to designate elements. Here is an example:
<HTML>
<HEAD>
<TITLE>
Some Shadow
Academy Staff
</TITLE>
</HEAD>
<BODY>
<UL>
<LI>
Toilet paper
</LI>
<LI>
Orange juice
</LI>
<LI>
Coffee beans
</LI>
</UL>
</BODY>
</HTML>
- Toilet paper
- Orange juice
- Coffee beans
<HTML>
<HEAD>
<TITLE>
Some Shadow
Academy Staff
</TITLE>
</HEAD>
<BODY>
<OL>
<LI>
Toilet paper
</LI>
<LI>
Orange juice
</LI>
<LI>
Coffee beans
</LI>
</OL>
</BODY>
</HTML>
- Toilet paper
- Orange juice
- Coffee beans
Here is an example:
<HTML>
<HEAD>
<TITLE>
Some Shadow
Academy Staff
</TITLE>
</HEAD>
<BODY>
<DL>
<DT>
Cow
</DT>
<DD>
An animal that goes "Mooooo!"
</DD>
<DT>
Tomato
</DT>
<DD>
A fruit that is used in many different kinds of salads.
</DD>
<DT>
Salad
</DT>
<DD>
Nutritious, delicious rabbit food.
</DD>
</DL>
</BODY>
</HTML>
- Cow
- An animal that goes "Mooooo!"
- Tomato
- A fruit that is used in many different kinds of salads.
- Salad
- Nutritious, delicious rabbit food.
-
As you can see, a Definition list is very different from an Ordered or Unordered list in that it shows a term and a description, not just a "bare bones" list.
Once you pass the HTML Basics exam, I recommend trying your hand at the Advanced HTML course, which covers several more topics, including frames and image maps.
Good luck with the exam, and remember, if you have any questions about the HTML Basics notes or exam, please feel free to contact me, the Eclectic Pedagogue.