HTML Examples

The following examples are used throughout the course slides. Select any of the examples to view the web page, then (in Internet Explorer) select VIEW and then SOURCE.

The HTML code will be displayed in Notepad. You can cut and paste this code into your own pages. Experiment, change the code and see the effect on the resultant page.

Example1.1 The HTML, HEAD and TITLE tags

Example1.2 The BODY tags

Example1.3 Creating headings <H1> - <H6> tags

Example1.4 The <P> tag and use of attributes

Example1.5 Unnumbered Lists <UL> <LI> tags

Example1.6 Ordered Lists <OL> tags

Example1.7 Definition Lists <DL> <DT> & <DD> tags

Example1.8 Before the COMPACT attribute

Example1.9 With the COMPACT attribute

Example1.10 Nested Lists

Example1.11 Preformatted text <PRE> tag

Example1.12 Displaying special caracters

Example1.13 Extended quotations <BLOCKQUOTE>

Example1.14 Forced line breaks <BR> tags

Example1.15 Horizontal Rules <HR> SIZE & WIDTH attributes

Example1.16 Linking, The anchor <A> tags

Example1.17 Named anchors. Jumping to sections in a document

Example1.18 Images

Example1.19 Image size attributes

Example1.20 Aligning images & text

Example1.21 Aligning at the TOP

Example1.22 Aligning at the CENTER

Example1.23 Aligning at the LEFT

Example1.24 Aligning at the RIGHT

Example1.25 Aligning images without text

Example1.26 Alternate text for images

Example1.27 Images as hyperlinks

Example1.28 The border attribute

Example1.29 Background graphics

The background image (backgrnd.gif) used in example1.29

Example1.30 Background and link colours (COLOR)

Example2.1 Table Format

Example2.2 Table Format

Example2.3 Table Format

Example2.4 Table Format