Introduction HTML

August 9, 2007

What is an HTML File?

HTML stands for Hyper Text Markup Language. An HTML file is a text file containing small markup tags. The markup tags tell the Web browser how to display the page. An HTML file must have an htm or html file extension. An HTML file can be created using a simple text editor

Do You Want to Try It?

Text Editor. If you are running Windows, start Notepad. If you are on a Mac start SimpleText. In OSX start TextEdit.

Simple HTML

Type in the following text:
<html>
<head>
<title>Title of page</title>
</head>
<body>
This is my first webpage. <b>This text is bold</b>
</body>
</html>

Save the file as mypage.htm Save as of type: All files
Start your Internet browser. Select "Open" (or "Open Page") in the File menu of your browser. A dialog box will appear. Select "Browse" (or "Choose File") and locate the HTML file you just created - "mypage.htm" - select it and click "Open". Now you should see an address in the dialog box, for example D:\DAW2007\mypage.htm Click OK, and the browser will display the page.

HTML Tags

HTML tags are used to mark-up HTML elements. HTML tags are surrounded by the two characters: < and > . The surrounding characters are called angle brackets. HTML tags normally come in pairs like <b> and </b>. The first tag in a pair is the start tag, the second tag is the end tag. The text between the start and end tags is the element content.
HTML tags are not case sensitive, <b> means the same as <B>.

Why do We Use Lowercase Tags?

We have just said that HTML tags are not case sensitive: <B> means the same as <b>. When you surf the Web, you will notice that most tutorials use uppercase HTML tags in their examples. We always use lowercase tags. Why?

If you want to prepare yourself for the next generations of HTML, you should start using lowercase tags. The World Wide Web Consortium (W3C) recommends lowercase tags in their HTML 4 recommendation, and XHTML (the next generation HTML) demands lowercase tags.

Tag Attributes

Tags can have attributes. Attributes can provide additional information about the HTML elements on your page.
This tag defines the body element of your HTML page: <body>. With an added bgcolor attribute, you can tell the browser that the background color of your page should be red, like this: <body bgcolor="red">
Attributes always come in name/value pairs like this: name="value"
Attributes are always added to the start tag of an HTML element.

Quote Styles, "red" or ‘red’?

Attribute values should always be enclosed in quotes. Double style quotes are the most common, but single style quotes are also allowed.
In some rare situations, like when the attribute value itself contains quotes, it is necessary to use single quotes:

name=’John "ShotGun" Nelson’

By ian

Get free blog up and running in minutes with Blogsome | Theme designs available here