|
Lesson One
Basic tags to create a web page.
Open Notepad (SimpleText - MAC users, or the text editor of your choice - make sure you can save your file as .html) and begin by typing...
<HTML>
</HTML>
These tags tell your browser what language is used to write your web page. There is a starting tag and a closing tag. A closing tag is easily recognized by the / (slash) added to a duplicate of the starting tag. Most, but not all tags have a closing tag. Think of tags as talking to the browser, or giving it instructions. What you have just told the browser is <HTML> is the start of your HTML document and </HTML> is the end of your HTML document.
Every HTML document needs a pair of HEAD tags. Add these now.
<HTML>
<HEAD>
</HEAD>
</HTML>
Note, I find it easier to locate my tags in the coding if I write them all in Upper Case, as I have done in this tutorial for your convenience. HTML does not care if you use upper or lower case tags. Other web languages do however, so keep that in mind should you proceed beyond HTML someday.
For a basic page, the only thing you have to concern yourself with between the HEAD tags are the TITLE tags. Add these now, along with your actual page title.
<HTML>
<HEAD>
<TITLE> My First Web Page </TITLE>
</HEAD>
</HTML>
The main content of the page will be within the BODY tags. Add these now, along with a simple sentence.
<HTML>
<HEAD>
<TITLE>
My First Web Page
</TITLE>
</HEAD>
<BODY>
Everything I want to say on my page is right here.
</BODY>
</HTML>
Congratulations - you have just written the code for your first web page.
Save this page as an html document somewhere on your hard drive where you will remember it. Call it page1.html.
To do this, in your Notepad window click File then Save As. Where it says File name: type in page01.html.Always use lower case letters when working with web file names and link names - more on that later.
Then where it says Save as type: make sure it says All Files(*.*) then click Save.
Now find the file using Windows Explorer, File Manager, Find File, or whatever program you use to manage files on your hard drive. You should be able to double click on the file name and be able to see it displayed as a web page in your browser. If your browser is not open, it will automatically when you double click on any .html file.
Another way to open a web page you have written is by opening your browser, choose FILE from the drop down menu at the top, select OPEN (or Open File or Open Page - NOT Open Location - depending on your browser).
A dialog window will appear. Type in the file location on your hard drive OR click on BROWSE to find it. Once you find it, highlight it by clicking on it once, then select OPEN (or just double click on the file name). Then select OK (or OPEN depending on your browser).
Notice the document title is what appears at the very top of the browser window (upper left corner of your screen). You should also notice the address refers to your computer instead of an Internet address. , If C is your hard drive and you saved the file in the My Documents folder, it might look something like this C:\My Documents\page01.html.
You should always make sure your web pages work on your computer before uploading them to the Internet. I will cover Uploading in another lesson.
Click here to see what your page should look like. This example will open in a new browser window. Simply close it when you are done.
|