Introduction
What Is HTML?
Where Does HTML Come From?
Where Can I View HTML?
Where Can I Write HTML?
Basic Syntax
Basic Rules
Basic Elements
Example
Text
Formatting
Links
Lists
Images
Tables
Frames
Forms
Conclusion


Basic Rules
Case Sensitivity
Element or attribute names are not case sensitive.

<hTml> = <HTML> = <html>

It is customary to use uppercase for elements and attribute names, except when attributes are used for script event handling mixed cases are used. For example: onMouseover=" ". While attribute names are not case sensitive, attribute values can be. An example is when the value is referring to a file that is contained on a server, like UNIX, which is case sensitive. You must use the same case that the file name is specified as; if you are creating a new file make sure to save it using only lowercases and use the underscore key "_" instead of spaces. It is best to just use lower cases for all attribute values. Following these principles will make your HTML easier to comprehend and maintain, especially when used by others.

Spacing
There should be no spacing inside the element's name. The first space inside an HTML tag signals the end of the element's name and the beginning of the element's attribute.

Attribute names also may not contain spaces, since each space would signify the beginning of a new attribute. Although attribute values may contain spaces as long as the value is contained inside of quotes. For the sake of convention it is best to just quote all attribute values with quotes.

Unknown Elements or Attributes
When a Browser encounters unknown elements or attributes, they will simply just ignore them. When an unknown element encloses text, the browser will ignore the element but not the text, and it will display it as plain text. As for unknown attributes the browser will ignore the attribute and the value attached to it.

Content Model
HTML specifications define the type of content an element can enclose, or it's content model. This can include other elements, text, a mixture of elements, and text, or nothing at all. For example, the <HEAD> element provides general information about an HTML document. Its content model only allows it to contain a small number of related elements such and <TITLE> and <META>. The content model for the bold element <B> allows it to enclose text and some elements, such as the one for italic <I>, but not others like <HEAD>. The content model of the break element <BR> is empty because it encloses no content. Content models define the relationships that are possible between elements and content in valid HTML documents.
-   HTML Programmer's Reference
    Thomas A. Powell and Dan Whitworth


Proper Nesting
When applying two or more elements on the same content or reapplying the same element, you should nest and not cross them. The element of last opening tag should be the element of the first closing tag. An example is if you want to bold and italicize some text:

Incorrect Correct

back  next

© Copyright 2000-2002 by Pepmint.com. All Rights Reserved

Search Pepmint.com

home :: tutorial :: portfolio :: links :: hammies :: guestbook :: contact