horizontal rule

Html 101

horizontal rule

Unit 1: Tags

HTML tags are just instructions on formatting. They are usually U.S. words (like <BODY> for the body of the page) or abbreviations (like <B> for bold). They are different from the regular text because they are placed in angle brackets (the greater than and less than symbols).

For example:

<B>This is a test. </B>

will be displayed by your browser as

This is a test.

Those tags are invisible, they will not appear on the page when looked at it with a browser.

HTML tags come in pairs. Every time you use a tag like <B>, you must also close it with another tag, such as </B>.The opening (first) tag turns on a command. The closing (second) tag turns it off. A slash (/) in the tag tells the browser that this is a closing tag. Only the information that is between the opening and closing tags will be affected.

For example:

<B> This </B> is a test.

Will look like this:

This is a test.

Tags have different functions:

a.      Some tags, like the <B> tag, tell the browser how the words should appear.

b.      Other tags tell the browser how the page will be formatted. For example, <P> begins a new paragraph. The <BR> tag is a line break.

c.      Still others simply provide information, such as the title of the page, that doesn't appear on the page itself.

Always double-check all your tags. If you are missing a closing tag, your page might look different than expected, or, if it is a really important tag, your page might not show up at all!

All HTML tags use American spellings for words, such as color and center. HTML tags are not case sensitive, so you can use either upper or lower case letters, and for the most part they are not sensitive to spaces.

Create your first page

The basic HTML page begins with the tag <HTML> and ends with </HTML>, telling your browser that this is a html document.

Inside these tags are the header and the body.

Every HTML document should contain these three HTML tags:< html>, <head> and < body>.

The header, enclosed by the <HEAD> and </HEAD> tags, contains information about a page, like the page�s title, which is displayed at the top of the browser window. The head contains the title. The title of the <HEAD> tags will not be seen on your web page, but is used to identify your page to the browser. The title is typically displayed in the title bar at the top of the browser window, but not inside the window itself.  A title is also used to identify your page for search engines (e.g. Yahoo, AltaVista).

The body, which begins with <BODY> and ends with </BODY>  is where the action is. Everything that appears on a web page is inside these tags.

Your basic document will look something like this:

<HTML>

<HEAD>

<TITLE> This is my site! </TITLE> </HEAD>

<BODY>

<B> School </B>

<P> I love school! My favourite subject is Math. What about you? </P>

<P> I like doing my homework.  I wish my teacher would be give me more than an hour worth of homework.</P>

          <P> If you love school like I do, please e-mail me. </P>

</BODY>

</HTML>

Build this page in Notepad or WordPad (to be found in Accessories). To save your document, click on "File" and then on "Save As".  Next to "Save In", choose the M drive. Next to "File Name" save your document with the file extension .html, for example: school.html. Next to "Save as Type" choose "Text Document". Click then on the "Save" button.

Viewing Your HTML Page

Once you've written the html code for your web page, save your page as an HTML document (using .html file extension). Once it is saved, go to the M drive, locate your document, and double click it.

Assignment 2: Create a simple web page about yourself, using the tags that you have learned, save it and display it in your browser.

 

horizontal rule

Next