HTML tutorial
Purpose:
Introduce you to basic web page coding. This is a basic tutorial which
will prepare you for the use of more sophisticated HTML editing tools.
Importance:
Very fe w people code HTML by hand anymore. There are a m ultiplicity
of program s such as Dream Weaver and Microsoft Front Page which help
ma ke the process of web page creation easier. BEFORE you learn to use
these tools, it is im portant to learn the basic structure and components of
the code/language. This will come in handy when you need to
troubleshoot code which editing tools can' t fix.
Goals: After this activity, you will be able to:
• Set up your server account to serve your personal web page
• Build a basic text web page
• Format and stylize your web page font
• Add images to your web page
• Add and control hyperlinks
STEP 1: SETTING UP YOUR SERVER ACCOUNT TO HOST YOUR
WEB FILES
You will be creating HTML (Hyper Text Markup Language) documents. These are the
files/instructions a browser (i.e. Netscape/Inte rnet Explorer) reads and uses to show web
pages. In order to create your own hom e you need to place your HTML (Hyper Text
Markup Language) documents in a world read able directory nam e d "www" in your hom e
directory (on your server account). This di rectory is automa tically created for new
accounts, so in most cases you should not need to create it. If it DOES NOT exist (You
do not have to do this right now, but can hop over on one of the server machines if you
would like to check/do this), open the server and create this directory, using the following
c omma nds :
cd
mkdir -p www
fs sa www system:anyuser rl
This creates a directory nam e d www into wh ich you will place all file relating to your
hom epage. Now, within that directory, you have to create a file (hom e.html ) written in
htm l f ormat. Note that HTML documents MU ST end in ".htm l " or ".htm" . W e will use
".html " as our standard. Once you have created your home.html file, the URL for that
page (your home page) would be: http://w eb.m it.edu/usernam e /www/hom e.html . Anyone
in the world can view this web page with a browser.
STEP 2: MAKING THE "HTML" WEB FILES
HTML files are text files which contain th e code of a web page. Today you will learn
how to program som e basic HTML code. When beginning, it is best to use a simple text
editor such as notepad or em acs. You can open notepad in the following way:
1. Click on the Start Button
2. Click on Run
3. Type in: notepad
4. Press ENTER on the keyboard
The notepad window should pop up, if not, ask for help.
STEP 3: LAYING OUT THE BASIC STRUCTURE OF THE PAGE
HTML files have a basic structure that you MUST work within. Before you begin the
tutorial you should type or copy/paste the following 8 lines from this screen into the text
file (file you have open in notepad):
<html>
<head>
<title>MY HOME PAGE NAME</title>
</head>
<body>
THIS IS WHERE THE CODE FOR BODY (WHAT YOU SEE IN
NETSCAPE/INTERNET EXPLORER) OF THE WEB PAGE GOES.
</body>
</html >
The text/bracket combinations are called tags. No te they com e in pairs. There is always a
beginning tag (<title>) and an end tag (</title>). The beginning tag signals Netscape /
Internet Explorer that a new tag/task is starting. The end tag tells Netscape / Internet
Explorer that the tag/task has ended. You will learn more about these in the tutorial. Save
the above file to the desk top of your com puter as: hom e.html . Make sure to add the
extension ".html " to the end of the file!!!!!
STEP 4: OPENING THE HTML FILE IN NETSCAPE/INTERNET
EXPLORER
Now you can view the results of your work:
1. Go to or open Netscape/Internet Explorer
2. File > Open or Open Page
3. Press the Choose or Browse button
4. Browse to the desktop and double click on home.html
5. Click Open/OK to load the file
If this did not work, ask for help.
STEP 5: MAKING YOUR FILES READABLE ON THE WWW
To ma ke your files accessible to the world (later on), you m ust store them in your server
account (You do not have to do right now, but you could ftp the file to the server if you
wanted) within the www file. Later on, you can use Em acs or other text editor on the
server to edit the hom e.html file.
STEP 6: USING NETSCAPE/INTERNET EXPLORER AND THE TEXT
EDITOR TO UPDATE AND VIEW THE RESULTS
VERY IMPORTANT!!!!!
Instead of copying and pasting the text from the tutorial into the Netscape/Internet
Explorer browser text window (as suggested in the "TRY IT YOURSELF SECTIONS!"
of the tutorial), you should paste the code into your home.html (inside notepad) file.
You can then reload the file into Netscape/Internet Explorer to see the results:
1. Select the text from the tutorial you wish to copy
2. Copy the text by pressing: Ctrl+C (the control and c key simultaneously)
3. Switch to notepad
4. Place the cursor where you want to paste the text
5. Paste the text by pressing Ctrl+V
6. Modify the text/code if you need to
7. Save the file
8. Load the file into Netscape/Internet Explorer, OR if you are already viewing the
file in Netscape/Internet Explorer, press the reload (called refr esh in Internet
Explorer) button to view the page with changes.
Use this procedure to obtain experience in using a text editor and Netscape / Internet
Explorer to write and debug your pages.
STEP 7: RUN THE TUTORIAL
Start the tutorial at: http://www.davesite.com/webstation/htm l/index.shtm l. Your job
today is to finish chapters 1 - 5 of the tutorial on HTML. Chapter 0 is not necessary.
YOU WI LL HAVE TO MOVE FAST TO FINISH THIS!!!
- Ch. 1: The Basics [What a tag is, Docum e nt Structure]
- Ch. 2: The Common Tags [Headings and Horizontal Ruled Lines]
- Ch. 3: More Com mon Tags [Paragraphs, Text Form atting, ALIGN, and
Line Break]
- Ch. 4: Links and Im ages
- Ch. 5: A Little More Tags [Centering, BODY, etc.]
No comments:
Post a Comment