|
H T M L |
PAGE (4 of 8) |
![]()
This is wrong.
This is right,
<B>Don't <I> overlap </I></B> opening and closing tags.
Below is a very basic listing of HTML tags with a description and example for each where possible.
Attributes are listed in the white boxes. Those attributes in BOLD type are required attributes.
|
The Skeleton |
|||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
<HTML> |
Tells the browser that this is an HTML-formatted file |
||||||||||||
|
<HEAD> |
Header tags surrounding information about the document like <TITLE> |
||||||||||||
|
<TITLE> |
Puts a title for the document at the left of the top bar of the browser window. This must be inside the <HEAD> tag. |
||||||||||||
|
<BODY> |
|
||||||||||||
|
Basics: |
|||||||||||||
|
<!-- TEXT --> |
Comment: Text inside this tag is not displayed in the browser. Use this for internal comments on your code. There is no closing tag for this. |
||||||||||||
|
<HR> |
Draws a horizontal rule across the document. No closing tag.
|
||||||||||||
|
<H1>...<H6> |
Headings: 1 through 6 designate the level of heading, where 1 is the highest level and thus largest. <H3>This is a third level
heading</H3> This is a third level heading |
||||||||||||
|
<P> |
Designates a new paragraph in the text. A closing tag is optional. |
||||||||||||
|
<BR> |
Adds a line break in the text. This doesn't need a closing tag. Text with a linebreak <BR> in it. Text with a linebreak |
||||||||||||
|
<IMG> |
Inserts an image into the document.
|
||||||||||||
|
<A> |
Anchor, otherwise known as a link
|
||||||||||||
|
Text Style: |
|||||||||||||
|
<FONT> |
|
||||||||||||
|
<B> |
For bold text. |
||||||||||||
|
<I> |
For italic text. |
||||||||||||
|
<U> |
For underlined text. |
||||||||||||
|
<EM> |
For emphasis on text. |
||||||||||||
|
Alignment: |
|||||||||||||
|
<CENTER> |
Centers text or object in relation to surrounding
text. Centered text |
||||||||||||
|
<ALIGN> <VALIGN> |
ALIGN and VALIGN (vertical align) are attributes for tags such as TABLE, TD, TR, IMG, H1..H6, HR. Some values that can be assigned to these follow:
|
||||||||||||
|
<PRE> |
Designates pre-formatted text. Preserves carriage
returns, spaces and tabs. <PRE>Preformatted text</PRE>
Preformatted text |
||||||||||||
|
<CODE> |
Designates source code listing |
||||||||||||
|
<BLOCKQUOTE> |
Indents the text on the right and left. Blockquoted text is indented on the right and left-hand sides. |
||||||||||||
|
Lists: |
|||||||||||||
|
<OL> |
Formats an ordered list |
||||||||||||
|
<UL> |
Formats an unordered list |
||||||||||||
|
<LI> |
Designates a list item within an ordered or unordered list. Unordered list items get a bullet, while an ordered list item is numbered. Nested lists are allowed |
||||||||||||
|
<OL>
|
|||||||||||||
|
Tables |
|||||||||||||
|
<TABLE> |
|
||||||||||||
|
<TR> |
|
||||||||||||
|
<TD> |
|
||||||||||||
|
Common Colors Table |
|||
|
Color |
Associated |
Color |
Associated |
|---|---|---|---|
|
Red |
#FF0000 |
Turquoise |
#00FFFF |
|
Light Blue |
#0000FF |
Dark Blue |
#0000A0 |
|
Light Purple |
#FF0080 |
Dark Purple |
#800080 |
|
Yellow |
#FFFF00 |
Pastel Green |
#00FF00 |
|
Pink |
#FF00FF |
White |
#FFFFFF |
|
Light Grey |
#C0C0C0 |
Dark Grey |
#808080 |
|
Black |
#000000 |
Orange |
#FF8040 |
|
Brown |
#804000 |
Burgundy |
#800000 |
|
ForestGreen |
#808000 |
Grass Green |
#408080 |
For A More Detailed Description of HTML Tags, see:
This is a very extensive description of tags and their usage. Includes all the tags in the HTML 3.2 specification, as well as Netscape extensions included in versions of Netscape Navigator up to 3.0b5.
The Ten Commandments of HTML FAQ is also a good link describing some of the quirks of browsers and how they treat HTML files differently.
Courseware Web - HTML from ChalkSoft Software is a very good free downloadable HTML tutorial. Just download it, execute it to decompress it and open the index.html in your Web browser to use it.
|
© CS Dept Va Tech, 1997-1999. |
All rights reserved. |