







Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!








Getting Started with HTML
Introduction Refer to the HTML Handbook 1.0.0. pdf previously provided and read the contents of Lesson One
Creating an HTML document
NOTE:
For example, let's suppose one address from a web page is: http://www.egerton.ac.ke http://www.safaricom.co.ke http://www.google.com
Loading your HTML document into the browser Once you have saved your HTML file or document, you need to SWITCH over to your browser which is running in the background. On the browser, go to File menu and select Open ... or Open File ... or Open File in Browser ... (depending on the browser you are using). You will then need to locate your file, click on the file name and then click the Okay button. Your HTML file will appear in the browser. You can only observe your file in the browser - you cannot edit in the browser. Once you have seen how your HTML file looks in the browser, you can then SWITCH back to NOTEPAD to continue working and editing.
In this section we will study the HEAD, TITLE and BODY container elements and we will learn about these tags (most people still refer to "elements" as "tags") by studying the following HTML document. It is good to be actively involved in each lesson, so please start up NOTEPAD, and type in the following HTML web page. After you have typed it in, save the document using any suitable name (such as RIDDLE.HTM), and then go to your browser and load the document into your browser to see the results as they should be (given below the document).
Here is the web page. Please type:
WEB PAGE DESIGN - BASIC TAGS
Hi, my name is Wycliff Oparanya.
This is my first attempt at a Web page. Here is a riddle for you.
What is between “YOU”?
Definitely “O”.Now when you load this document into your browser, you should see the following on the screen: Hi, my name is Wycliff Oparanya. This is my first attempt at a Web page. Here is a riddle for you.
What is between “YOU? Definitely “O”
Now for a discussion on this HTML document. Line 1 of what you typed in () tells the browser that what follows is an HTML document, and the last line () tells the browser that the HTML document is finished. Line 2 () is a new tag which we will now take a look at this tag.
** and tags** Each page of your web pages should have these tags. Statements (or tags) that give information to a person visiting your website, or information such as those needed for a Search Engine are placed between the and tags. Thus the HEAD part of a document provides information about the document. You do not see this information displayed on the browser screen. It can be seen by choosing DOCUMENT SOURCE from the VIEW menu of your browser.
Line 4:
Why did the lobster blush?
Line 5: Because it saw the salad dressing.What is displayed on the browser:
Hi, my name is John Gilson. This is my first attempt at a Web page. Here is a riddle for you.
Why did the lobster blush? Because it saw the salad dressing.
Discussion Notice the
at the end of line 1. It simply tells the browser to drop down to the next line. The tag at the end of line 2 placed the first line across the page. Notice that the tag does not place any blank lines (empty rows) above or below the Horizontal Rule.
Problem 2: Why is the
tag at the beginning of line 4 ("Why did the lobster blush?") and not at the end of line 3 ("Here is a riddle for you.")? The second line across the page was placed by the
tag at the end of line 4. At line 5, the firstProblem 3: One
has the same effect as two
tags since the
tag forces a blank line before continuing on. Why then did I not simply use one
tag instead of two
tags at the end of line 5?
Problem 4: What does HR stand for in
?Problem 5: Do all tags require a beginning and an ending tag?
Pr oblem 6: Must tags be written in capital (upper case) letters?
Problem 7: When you typed in the above HTML document, some of the tags were indented (such as and ). Do you have to indent tags?
Problem 8: Based on your knowledge of the basic tags, write down exactly what you think will be printed by your browser for the following HTML document. The answer is given in the answer section. Let's assume that the , and tags have already been typed in.
<BODY> I am learning a lot about
designing my own web pages. </BODY></HTML>
THIS IS H2.
THIS IS NORMAL SIZE.
THIS IS H5.
THIS IS NORMAL SIZE.
THIS IS H6.
THIS IS NORMAL SIZE.
Note the following points: gives the largest size heading while gives the smallest size heading. In most browsers, the HEADER tags print the headings in boldface. A Level 1 heading (H1), because it is the largest heading, is considered to be the most prominent or most important heading. The Level 2 heading (H2) is the second most important heading. That is, it is more prominent than a Level 3 heading (H3) but less prominent than a Level 1 heading.
Good HTML form dictates that HEADER tags should be used in hierarchical order. Don't jump all over the place with your heading levels. For example, if you use a Level 2 heading for a title or heading, then the next size to use for a sub-title would be a level 3 heading.
If you look at the lines you typed in between the and tags, you did not type in any
or
commands. For example, we did not type in a
tag between "THIS IS H1" and "THIS IS NORMAL". Yet they were printed by the browser on separate lines. They should have been printed on the same line. Also, there is no
tag at the end of any line and so everything should have been printed by the browser on one long line. Well, the reason for all this is that HEADER tags (such as
tags with HEADER tags. Of course, if you want additional blank lines before or after a HEADER tag, you will then need to use
or
tags.
Final remarks on the HEADER tags:
CENTERING TEXT The center command is: ALIGN="CENTER" (no spaces around the equal sign) and must be used in conjunction with a HEADER tag or the PARAGRAPH tag as in:
a heading goes here or
a paragraph or block of text goes here
Here are some points to remember concerning these two centering commands.
In other words, we are centering a "paragraph" or "block of text" with each line centered on the screen just as these lines are centered (hopefully). To end centering a block of text, we use the
tag which is the closing paragraph tag. This tag is a new tag for us and one that you may not end up using all that often. But it does have its uses and this is one of them. Choose DOCUMENT SOURCE from the VIEW menu if you want to see how I centered these lines.Now load the document into your browser and your web page should look like the following:
Northern Ontario:
1.5 square miles. Camping, fishing ( walleye, northern pike, brook trout ), canoeing, self-
guided nature trails.
Recommended
Here are some questions for you to answer on the above example followed by a discussion on the emphasis tags.
Problem 3: Which tag appears to "bold" text?
Problem 4: Which tag tells the browser to write the text in italics?
Problem 5: How was the word "Recommended" printed?
Problem 6: Why is there no
tag at the end of the line "OUTDOOR LIVING IN
ONTARIO" or a
in front of the line "POINTS OF INTEREST" of the document you
typed in?
is used to emphasize text. It is a logical tag and so describes the meaning of the text to be displayed rather than how the text is to be displayed. In most browsers, the meaning is italics. However, if the browser doesn't support italics or the viewer changes the meaning, the browser will pick the best alternative way to display the text on the screen.
= STRONGLY EMPHASIZE TEXT is also a logical tag. It is used to strongly emphasize text. is distinct from . In most browsers, STRONG is identical to boldface. If a browser does not recognize boldface or if the viewer changes the meaning of STRONG, then the browser will pick the best alternative from the platform it is running on.
Using for Boldface or for Italics is accepted by all browsers as a way of strongly emphasizing text which in most cases is boldface. Instead of the and tags for strongly emphasizing text, you will sometimes see and for bolding text. While is a "Logical Style Command", is not. is a "Physical Style Command". A physical style command cannot be rendered differently.
Therefore if a browser does not accept the tag, then your text will simply not be bolded as the browser has no alternative way to display them on the screen. The same reasoning is also be applied for using the tag to print in italics instead of the tag. Now if for some reason you want to ensure only italics or boldface and nothing else, then use the italic font or the boldface font .Here is your final problem to see how well you learned the information given in this lesson. Problem 7: Make up an HTML document in NOTEPAD that gives the following web page in the browser. In other words, when you are finished, your browser should show exactly the following:
1 large bunch of greens, preferably mixed 10 cherry tomatoes quartered
DRESSING 1/2 cup Mayonnaise 2 tbsp. Minced dill or sweet pickle 1 tsp. Prepared mustard 1/4 tsp. Onion powder 1 tsp. Granulated sugar 1 tbsp. Milk
Have greens ready in separate containers in refrigerator.
Dressing: Combine all ingredients together in a small bowl. Mix well. Spoon over greens. Toss to coat. Add tomato and toss together lightly. Serves 8
Here are some popular symbols and their ampersand commands that work in all browsers
Reading Assignment 1 Read about indenting and the various ways lists are created. That is using ordered, unordered, and definition lists and hence using notepad, write a script that will provide an output as shown below.
FINDING YOUR WAY IN THE WILDERNESS
If you are inexperienced do not travel alone do not travel at night If you do get lost Don't panic Don't wander in the dark Give distress signals at regular intervals such as:
It may be wise to sit tight and wait for searchers