![]()
(HyperText Markup Language)
Web pages are written in a language all their own - HyperText Markup Language (HTML). You must either "speak the language" or use a computer program that translates for you. You can see the HTML source code for any Web page by pulling down the View menu along the top of the Internet Explorer (or Netscape) window and choosing Source (or Page Source).
HTML combines plain text with "tags" to format the text. An HTML tag consists of a left angle bracket < followed by a name of a tag and closed by a right angle bracket >. Tags are usually paired, the ending tag looks just like the beginning tag except a slash / precedes the text within the bracket. For example, a tag to start making text bold is <B>. The tag to stop making text bold is </B>. Tags are not case sensitive. Upper case and lower case letters are treated the same.
In
this class, we will be writing HTML code in Windows Notepad. The Notepad program
is accessible from the Windows Start menu
Programs
Accessories
Notepad.
Save all HTML documents in Notepad as a text document with an .html file name ending. To save as a text document:
On Windows 95/98 computers, all running (open) programs will be indicated on the Taskbar along the bottom of the screen. Single clicking on the name of the program will bring it up on the screen.
|
REMEMBER!!!
After you make changes in your file, you must
re-save it ( File |
Basic
HTML Layout
All Web pages should have the following basic
layout.
|
<HTML> |
Break
Tag <BR>
The
<BR> tag stops the line of text and begins the next word on
the following line. There is no ending tag.
Paragraph
<P>
The <P> tag stops the line of text, inserts a blank line, then
continues the text one line down. The ending tag </P> is optional.
Bold
<B> . . . </B>
The
<B> bold tag makes the text appear bold. The ending
tag is </B>. Here is an example of how the bold tag is used:
The
HTML: The <B>dog</B> barked.
The results: The
dog barked.
The HTML: The <I>cat</I> meowed.
The results: The cat meowed.
<H1>,
<H2>, <H3>, <H4>, <H5>, <H6>
|
The
HTML: <H1>The Big Show</H1> |
The
HTML: <H6>The Big Show</H6> |
Center
<CENTER> . . .</CENTER>>
This
tag centers (aligns horizonally) the text on the page. Don't forget the
ending tag </CENTER>
Image
<IMG SRC="filename.gif">
Image
tags do not have an ending tag.
A few of the attributes you can add to the image tag include:
Align=left
(image aligns left and text wraps to right
of image)
Align=right (image
aligns right and text wraps to the left of the image)
Width=xxx (width
of the image in pixels)
Height=xxx (height
of the image in pixels)
Alt="xxxxxx"
(description
of image)
VSPACE=xxx (vertical
space in pixels between image and text)
HSPACE=xxx (horizontal
space in pixels between image and text)
Each attribute is separated by at least one space. The order of the attributes
in not important.
Here is an example of an image tag using some attributes:
<IMG SRC="wolf.gif" align=right width=155 height=87 hspace=5 alt="A Timber Wolf">
NOTE: The numbers in the above example are in pixels. There are 72 pixels
to the inch.
<A HREF="http://www.foxsports.com">Fox
Sports</A>
The words Fox Sports will be the blue underlined-link words. The ending tag is </A>
When linking to a page in the same directory, you do not use http://.
Simply put the name of the file in quotation marks.
<A HREF="page2.html">The next page</A>
The ending tag is </A>
The <HR> tag produces a 3-dimensional horizontal line across the page.
To make the line extend only part way across the page, you can specify a width
in percent, such as <HR WIDTH=50%>. You might want to put a <CENTER>
tag before (and after) the <HR> tag if you specify a percent width.
There is no ending tag.
<CENTER><HR WIDTH=75%></CENTER>
Unordered lists are "bulleted" lists. An unordered list starts with
the <UL> tag and ends with the </UL> tag. Each bulleted item begins
with the <LI> tag. An unordered list puts a blank line before and after
the list.
Here
is the HTML:
<UL>
<LI>Apples
<LI>Pears
<LI>Bananas
</UL>
Here is the result:
Ordered List <OL> . . . </OL>
Ordered lists are "numbered" lists. An ordered list starts with the <OL> tag and ends with the </OL> tag. Each numbered item begins with the <LI> tag. An ordered list puts a blank line before and after the list.
Here
is the HTML:
<OL>
<LI>Apples
<LI>Pears
<LI>Bananas
</OL>
Here is the result:
A definition list consists of two parts: the term to be defined <DT>,
and the definition <DD>. The definition is displayed indented
under the term.
Here
is the HTML:
<DL>
<DT>Hodgepodge
<DD>A thick stew of various meats and vegetables
<DD>Any jumbled mixture
<DD>Mess; medley
<DL>
Here is the result:
Hodgepodge
A thick stew of various meats and vegetables
Any jumbled mixture
Mess; medley
Any text between the block quote beginning and ending tags will be indented
on all four sides. In other words, it will have a blank line before and after
it. There will also be an indent on both the left and right sides of the text.
Background Color BGCOLOR
You can specify a solid color background for your web pages. This is done inside the beginning <BODY> tag. You can either specify a color "word," or you can use hexadecimal values. Here is an example of each type:<BODY BGCOLOR="white">
or <BODY BGCOLOR="#FFFFFF">For more information on background colors, visit the Background FAQ at www.two4u.com/bg-faq/.
Font <FONT> . . . </FONT>
You can specify font size, color, and style. Font sizes go from 1 (very small)
to 7 (very large). Font size 3 is average size.
Here
is the HTML for font size:
<FONT SIZE=6>This will be big
letters.</FONT>
Here is the result: This will be big letters.
Font colors are just like bgcolor with color names or hexadecimal values.
Here is an example of the HTML:
<FONT
COLOR="red">This will be red text.</FONT>
Here is the result: This will be red text.
You can combine size and color attributes in the same Font tag.
<FONT SIZE=4 COLOR="green"> . . . </FONT>
You can provide a link on your web page that will help the viewer send you
an e-mail message.
Here is the HTML for an e-mail link:
<A HREF="mailto:[email protected]">[email protected]</A>
Here
is the result: [email protected]