BASIC HTML TAGS

By John Nann, Educational Technology Specialist/

Legal Reference Librarian

Hypertext Markup Language (HTML) is a language used to create web pages and other documents that can contain text, graphics, and connections called hyperlinks. HTML uses a variety of Tags (code commands) to designate actions. The following is a list of basic tags.

Note: Almost all tags follow the following format: <TAG> . . . . </TAG>. (e.g. <B> . . . . </B> will bold everything between the tags.

DOCUMENT STRUCTURE TAGS

<HTML> . . . . </HTML> -- Indicates an html document.

<HEAD> . . . . </HEAD> -- Delineates the 'head' of the document.

<TITLE> . . . . </TITLE> -- Delineates the 'title' of the document.

<BODY> . . . . </BODY> -- Delineates the 'body' of the document.

Basic structure of almost every html document:

<HTML>

<HEAD>

<TITLE>Text</TITLE>

<BODY>

Text

</BODY>

</HTML>

DOCUMENT "LOOK" TAGS

<H1> . . . . </H1> (or H2, or H3, etc.) - Size of the heading between the tags (1 is the largest).

<FONT SIZE="X"> . . . . </FONT> -- Specifies that the text will be X font size.

<B> . . . . </B> -- Bold text.

<I> . . . . </I> -- Italic text.

<EM> . . . . </EM> -- Emphasis, usually (depends upon the browser) italics.

<STRONG> . . . . </STRONG> -- Strong emphasis, usually bold.

<HR> -- Horizontal Rule (line).

<BR> -- Line Break (Differentiate from a paragraph tags which adds an extra line).

<BLOCKQUOTE> . . . . </BLOCKQUOTE> -- Use for long quotes and to indent text.

<CENTER> . . . . </CENTER> -- The text will be centered on the page.

<P> . . . . </P> -- The material between the tags is a paragraph.

LIST TAGS

<UL> . . . . </UL> -- The entries will be a bulleted list.

<OL> . . . . </OL> -- The entries will be a numbered list.

<LI> -- List Entry

IMAGES and LINKS

<A HREF="XXXXXX"> . . . . </A> -- The material between the tags is a hypertext link. The material in quotes is the address. <A HREF="http://www2.bc.edu/~nannj">John's Homepage</A> The words 'John's homepage will appear as a hypertext link. When you click on them, they will take you to the address Http://www2.bc.edu/~nannj

<A NAME="anchor"> . . . . </A> and <A HREF="#anchor"> . . . . </A> -- allows linking to another spot on the same page. The anchor is the spot that you want to arrive at after clicking on the hypertext link: the name tag goes there. The hypertext tag will take you to the name tag . . .

<IMG SRC="XXXXX" ALIGN=MIDDLE> -- An image at location (or filename) XXXXX will appear in the page and will align in the middle of the page.

TABLES

<TABLE> . . . . </TABLE> -- The material between these tags will be a table. (<TABLE BORDER="2"> will make a table with a border 2 pixels wide.

<CAPTION> . . . . </CAPTION> -- A table caption.

<TR> . . . . </TR> -- A table row.

<TH> . . . . </TH> -- A table heading cell.

<TD> . . . . </TD> -- A table data cell.

ETC.

And there are a lot more . . .