LESSON 02 –
HTML BASICS
Note:
While the content in these lessons serves as a reference
to the student, students should note that it is difficult to understand if
you haven’t taken part in the in-class demos.
|
WHAT IS HTML?
HTML stands
for HyperText Mark-up Language. It is a language that specifies how to
display objects (text, images, graphics, tables, ...)
on the screen.
HTML is very
important because it can be understood by all computers. So even if two computers
are different (such as a MAC and PC), they can both still use HTML because they
both understand it.
FILE EXTENSION
An html
document is really just a text document with a different extension. This extension lets your computer know that
it should open the file with your internet browser.
Note that
both html and htm extensions are the same.
HTML is
simply text that makes use of tags to specify how to display things on the
screen. Tags always start with a <
symbol and end with a > symbol.
For example,
here are a three different tags:
<body>
<b>
<font
color=”blue”>
Many tags
that affect a certain section of your text have an opening and a closing
version. The closing version simply have
a / symbol after the < symbol.
For example,
the <b> tag bolds text. Below, the
word Campeau would be bolded because it appears between the opening and closing
<b> tags.
Mr.
<b>Campeau</b> is the best.
Some, or even
most, tags allow you to specify attribute values inside them. You can even specify multiple attribute
values in one tag. To do this, you must
first know the name of the attribute.
Then you simply add its name and an equal symbol followed by the value
that you desire.
For example,
the img tag (image tag) has the following attributes:
src, height, width, border. So, you can use the tag in any of the
following ways:
<img src=filename height=200
border=3>
<img src=filename>
<img src=filename border=2
width=400>
You sometime
need to put attribute values in double quotes.
In fact, Mr.Campeau prefers always putting the
quotes. Here is an example:
<img src=”filename” border=”2”>
The following
sequence of tags is common in all simple html documents:
<html>
<head><title>This appears in the blue section at the
top.</title>
</head>
<body>
</body>
</html>
COMMON
ERROR – THE <BODY> TAG
There is only
one <body> and one </body> tag.
You should never add more. You
can only make changes to that one tag.