HTML - Some Basic  Tags


Home
Getting Started
Getting Going
 
 
 
 

NB these are not case sensitive

Getting started

<!DOCTYPE HTML PUBLIC"-//WRC//DTD HTML 4.0 Transitional//EN> (goes in head)
<HTML></HTML> Beginning of HTML
<HEAD></HEAD> Head of web page. Contains info about the page.
<TITLE></TITLE. Appears in browser bar
<BODY></BODY> Main part of page

Text formatting

<P></P> Paragraph
<P ALIGN="  "></P> Paragraph with alignment specified (left, center, right)
<BR> Line break. Smaller spacing than new paragraph.
<H1></H1> Heading one - the largest. Smallest is <H6>
<B></B> Bold
<I></I> Italic
<U></U> Underlined
<HR> Horizontal rule (a line)
<UL></UL> Unordered list (bulleted)
<OL></OL> Ordered list (numbered)
<LI> List item
<DL></DL> Definition list
<DT> Defined term
<DD> Definition
<DL COMPACT></DL> Compact definition list (term and definition on same line)
<FONT FACE=" "></FONT> Style of font e.g. Arial
<FONT SIZE=" "></FONT> Size of font. Smallest is 1, largest is 6.
<CENTER></CENTER> Align in centre
<PRE></PRE> Display text with spacing as input
<BLOCKQUOTE> </BLOCKQUOTE> Indent text (as in quotations)
   

Colour

 
<BODY BGCOLOR=""></BODY> Background colour for page. Named colour or hexadecimal code.
<BODY TEXT=" "></BODY> Colour for text of whole page
<FONT COLOR=" "></FONT> Colour for text between the FONT tags

Images

 
<IMG SRC="    "> Reference to filename (and path) for image file
<IMG SRC=" " ALT="text"> Alternate text which shows instead of image
<IMG SRC=" " HEIGHT=" " WIDTH=" "> Size of image (speeds downloading). Not for changing image size.
<IMG SRC=" " ALIGN=" "> Alignment of image with text. Main options are LEFT or RIGHT
<BODY BACKGROUND=" "> Reference to image file for using as page background

Hyperlinks

 
<A HREF ="URL"></A> Hyperlink to another website
<A HREF ="filename"></A> Link to another page in your site
<A NAME ="anchor"></A> Naming an anchor for a link
<A HREF ="#anchor"></A> Link to a named anchor on the same page
<A HREF ="MAILTO: someone@isp.com"></A> e-mail link
<A HREF ="URL">
<IMG SRC= " "></A>
Using an image as a label for a hyperlink
<BODY LINK="    "> Specifies the colour of hyperlinks
<BODY VLINK = "    "> Specifies the colour of visited hyperlinks
<BODY ALINK = "   "> Specifies the colour of active hyperlinks

Tables

 
<TABLE></TABLE> Table
<CAPTION></CAPTION> Caption default is above and centred
<TR></TR> Table row
<TD></TD> Table cell
<TH></TH> Header cell

Attributes of tables/cells

 
WIDTH= Width of table or cell. Pixels or %
HEIGHT= Height of table or cell. Pixels or %
ALIGN=" " LEFT, RIGHT or CENTER
VALIGN=" " TOP, MIDDLE or BOTTOM
COLSPAN=n Number of columns a row spans
ROWSPAN=n Number of rows a column spans
BORDER=n Size of border in pixels
CELLPADDING=n Gap between contents and edge of cell in pixels
CELLSPACING=n Gap between cells in pixels
NOWRAP Keeps all the text in a cell in one line

Back to Top