Getting HyperHTML Basics
Understanding HTMLHypertext Markup Language (HTML) is the basic building block of the Web pageWhat is HTML?Hypertext Markup Language -- HTML -- is a streaming text language that uses tags to format text, create hyperlinks to other places, and insert images, sounds, and video. HTML files live on a server. When a web browser requests the file, the server sends across one long unbroken string of ASCII text. The browser turns the long string into a viewable page. Any formatting, extra spaces, or unrecognizable characters that you put into your HTML file will be completely ignored by the browser. It turns anything it doesn't understand into a single space. All HTML documents must have a filename extension of .html or .htm. For example, the name of this file is basic.html. The browser looks at the filename extension and knows to interpret the file as HTML tags rather than straight ASCII text. A core set of HTML tags are standard, while others are only supported by certain browsers. The status of the "standard" and "non-standard" tags is always changing and it is important to remember that your HTML file may display differently on different browsers. Tools You NeedTo create an HTML file all you need is a simple text editor, such as Notepad. You can also use word processors such as Word or Publisher and save the files as html. HTML-specific editors also exist. These editors support the basic
HTML tags and let you see the page as it will appear in a browser. Instead of typing tags,
you can select commands from pull down menus, and click and drag items. Adobe, Netscape,
Microsoft, Macromedia, and a score of other companies all offer HTML creation
tools. This type of HTML software is known as WYSIWYG - which means What
You See Is What You Get. It's important to remember that even if you are using these graphical HTML tools, it is helpful to understand the HTML code itself. Understanding a little simple code makes it easier to fix problems on your page and simply understand why certain things are happening. Back to top of page HTML Tag StructureIn HTML terms, a document is made up of elements, which are portions of a document's structure such as titles, headings, lists, or paragraphs. Elements are defined by marking them up with tags. There are two overall types of elements: Block Elements. A Block element defines a paragraph constructed broadly (including Headings, Lists, and ordinary text paragraphs). Browsers insert a blank line before a block element. Inline Elements. An Inline element defines a character styles, such as bold or italic, or some other element that fits within a line. Whether you're talking about block or inline elements, they both consist of some or all of the following components:
A typical HTML tag might look something like this: <H1 align="center">This is the element's content.</h1> In this example, the start tag is the heading1 tag
(<h1>). Every HTML document has a global structure, which informs the browser that it has encountered an HTML page. Additionally, the global structure divides the document into two components: Head. The information nested within the <head> element doesn't appear in the browser window, although <title> text does appear in the window's title bar. Body. The text and markup within the b<body> element appear in the browser window. Here's what the global structure looks like: <html> Back to top of page Here are a few guidelines for using HTML tags:
Back to top of
page |
This table summarizes the basic HTML tags. Click on a particular category of tags to jump directly to it, or browse the full reference list.
Document | Basic Text | Lists | Links | Images | Imagemaps |
Tables | Frames | Forms | META Tags | Style Sheets | Special Characters |
Structure Tags | |||
Function | Start Tag | Attributes | End Tag |
HTML File | <html> | none | </html> |
File Header | <head> | none | </head> |
File Title | <title> | none | </title> |
Comments | <!-- | Your comments go between the start and end tags. Put a space between the -- and your comments. | --> |
Body | <body> | background="filename" bgcolor="color value" text="color value" link="color value" vlink="color value" |
</body> |
Division | <div> | align="right/left/center" style="property:value;" class="classname" |
</div> |
Span (inline) | <span> | style="property:value;" class="classname" |
</span> |
Basic Text Tags | |||
Function | Start Tag | Attributes | End Tag |
Line Break | <br> | clear="left/right/all" | </br> or <br /> |
Paragraph | <p> | align="center/right" | </p> |
Bold | <b> | none | </b> |
Italic | <i> | none | </i> |
Typewriter Text | <tt> | none | </tt> |
Headline | <h1-6> | align="center/right" | </h1-6> |
Font | <font> | face="name, name" size="+/-value/fixed size" color="color value" Note: the font tag is being phased out in favor of CSS styles. |
</font> |
Horizontal Rule | <hr> | size="XX" width="XX/XX%" noshade |
</hr> or <hr /> |
Block Quote | <blockquote> | none | </blockquote> |
Division | <div> | align="left/center/right" | </div> |
List Tags | |||
Function | Start Tag | Attributes | End Tag |
Unordered List | <ul> | type="disc/circle/square" | </ul> |
Ordered List | <ol> | type="I/A/1/a/i" start="value to start counting at" |
</ol> |
List Item | <li> | type=all ul and ol options | </li> |
Definiton List | <dl> | none | </dl> |
Definition List Item | <dt> | none | </dt> |
Definition List Definition | <dd> | none | </dd> |
Link Tags | |||
Function | Start Tag | Attributes | End Tag |
Anchor Link | <a> | href="filename" target="windowname" |
</a> |
Anchor Mark | <a> | name="markname" | </a> |
Image Tags | |||
Function | Start Tag | Attributes | End Tag |
Insert Image | <img> | src="filename" align="left/right" width="XXX" height="XXX" alt="text that desribes image" ISMAP USEMAP="#mapname" |
</img> |
Client-side Imagemap Tags | |||
Function | Start Tag | Attributes | End Tag |
Define Map | <map> | name="mapname" | </map> |
Area Definition | <area> | shape="rect/circle/poly/point" coords="X,Y,X,Y" href="imagename" |
</area> |
Table Tags | |||
Function | Start Tag | Attributes | End Tag |
Table | <table> | border="X" width="XX/X%" cellspacing="XX" cellpadding="XX" bgcolor="color value" background="filename" |
</table> |
Table Row | <tr> | align="left/center/right" valign="top/middle/bottom" bgcolor="color value" |
</tr> |
Table Data | <td> | align="left/center/right"
valign="top/middle/bottom" width=X nowrap colspan="X" rowspan="X" bgcolor="color value" |
</td> |
Table Header | <th> | align="left/center/right" valign="top/middle/bottom" width=X nowrap colspan="X" rowspan="X" bgcolor="color value" |
</th> |
Caption | <caption> | align="left/center/right" valign="top/middle/bottom" |
</caption> |
Frame Tags | |||
Function | Start Tag | Attributes | End Tag |
Set Frames | <frameset> | cols="XX/XX%/*" rows="XX/XX%/*" |
</frameset> |
Frame Definition | <frame> | src="filename" name="framename" noresize scroll=auto/yes/no marginwidth="XX" marginheight="XX" |
</frame> |
Base | <base> | target="framename"/ "_self"/ "_top"/ "_parent" (Note the underscores) |
</base> |
No Frames | <noframes> | Between start and end tags, place the content that appears when a non-frames browser loads this page. | </noframes> |
Form Tags | |||
Function | Start Tag | Attributes | End Tag |
Form | <form> | method=get/put action="programname" |
</form> |
Input Field | <input> | name="variablename" type=text/password/ checkbox/radio/submit/ reset/image |
</input> |
Selection List | <select> | name="variablename" size=XX multiple |
</select> |
Selection Option | <option> | none | </option> |
Scrolling Text Field | <textarea> | name="variablename" rows=XX cols=XX |
</textarea> |
Meta Tags | |||
Function | Start Tag | Attributes | End Tag |
<meta> (Server metatags) |
http-equiv="refresh" content="seconds, filename" |
none | </meta> |
<meta> (Content metatags) |
name="keywords/description/author/ generator/abstract/expiration" content="your information" |
none | </meta> |
Style Sheet Tags | |||
Function | Start Tag | Attributes | End Tag |
Style Definition Area | <style> | type="text/css"> Style declarations go between begin and end style tags |
</style> |
Link to external CSS File | <link> | rel=stylesheet type="text/css" href="URL" |
none |
Commonly-Used Special Characters | ||
Name | Symbol | HTML Equivalent |
ampersand | & | & |
cent sign | ¢ | ¢ |
copyright symbol | © | © or © |
degree sign | ° | ° |
greater than | > | > |
less than | < | < |
non-breaking space | | |
registered trademark | ® | ® |
trademark | ™ | ™ |
Back to top of page |