Let's look at a page of text formatted with HTML tags.. It will appear in a new browser window on top of this one, so when you are finished looking at it, click on the "CLOSE BOX" in the upper left corner of the window on a Mac or the upper right corner on a Windows PC.
Now let's look at the same page formatted in a text editor. In the original, if you could see it, it has all the same breaks, italics, color, bold, and large size print as the HTML formatted one. The difference, of course, is that all the formatting tags have been removed.
Once again, this will be in a new window on top of this one, so close it when you are finished looking.
It should be pretty clear from that why we must use HTML tags to make pages look like we want them too in a browser.
|
<HTML> <HEAD> <TITLE><!-- The title you wish to show in the title bar of the window goes here --></TITLE> <!-- Other than TITLE,things like JavaScript code can go inside the HEAD tags, but that is beyond this course -->
</HEAD>
</BODY> |
Since HTML, HEAD, TITLE, and BODY are inside <. . .> they are TAGS, but not style tags. They are really SETUP tags for the HTML page. They break the page into regions where certain things need to take place. HTML inicates to the browser that this is an HTML page as opposed to a text or some other kind of page, and BODY indicates that here is the stuff that should be displayed.
The text in green with the <!-- . . . --> are called COMMENTS. Anything you enclose this way will be ignored by the browser when it is interpreting HTML tags. This gives you a good way of putting information in your page about how you have formatted it.
You will be able to switch back and forth between them by using the WINDOW menu in both Explorer and Netscape Navagator, and the COMMUNICATOR menu in Netscape Communicator.
Go back to your browser and click on the RELOAD button if you are using Netscape and the REFRESH button if you are using Explorer.
"My Very First HTML Page" should now appear in the title bar of the window.
This tag is one of the few that does not require a closing tag. The others you have seen need to know when to stop, say, "bolding" text, but a BREAK cannot be misconstrued that way.
If you put in two <BR>s, that is <BR><BR>, the second one will give you a blank line.
To test this, go to your text editor and SELECT and COPY the line you have entered in the BODY portion. Now PASTE it in under the line you already have there. SAVE, and RELOAD or REFRESH in the browser. Notice that the two lines run together even though they are typed on separate lines.
| HTML page formatting | This is my first <B>HTML</B> page and I am so <I>happy</I>to finally be writing one. This is my first <B>HTML</B> page and I am so <I>happy</I>to finally be writing one. |
| As viewed in the browser | This is my first HTML page and I am so happyto finally be writing one. This is my first HTML page and I am so happyto finally be writing one. |
Now type <BR> at the end of the first line you wrote. SAVE and RELOAD or REFRESH. You should see the sentences on two lines, one right under the other.
| HTML page formatting | This is my first <B>HTML</B> page and I am so <I>happy</I>to finally be writing one.<BR> This is my first <B>HTML</B> page and I am so <I>happy</I>to finally be writing one. |
| As viewed in the browser | This is my first HTML page and I am so happyto finally be writing one. This is my first HTML page and I am so happyto finally be writing one. |
Now put a <BR> right next to the last one and go through the process of viewing the page again. There should be a space between the lines.
| HTML page formatting | This is my first <B>HTML</B> page and I am so <I>happy</I>to finally be writing one.<BR><BR> This is my first <B>HTML</B> page and I am so <I>happy</I>to finally be writing one. |
| As viewed in the browser | This is my first HTML page and I am so happyto finally be writing one. This is my first HTML page and I am so happyto finally be writing one. |
Now you know how to write and view your own web pages. All the rest is just learning about other tags that will help you make your page more sophisticated.
BILL: Why did you call me a werewolf at the meeting last night?
LINDA: I didn't say you were a werewolf, I said you were a vampire.
BILL: On what evidence do you base that claim. Have you ever seen me drink blood?
LINDA: I secretly video taped you doing that and then turned over the tape to the DA.
BILL: That is really showing friendship. You lure me into drinking blood,
and then you turn me in. I would call that betrayal.
LINDA: Well, I have to admit that I have been out to get you. Ever since
I read Dracula, I've wanted to do in a vampire.
After reading the answers, to put things back the way they were, use the BACK button or scroll down to the link at the bottom of the "Answers" page.