Beginning Web Programming - Code Examples

Back to main book index

Chapter 1: Creating Structured Documents

Here are the examples for Chapter 1, which introduces you to the main XHTML elements that add structure to your pages and text.

ch01-eg01.htmlYour first web page
ch01-eg02.htmlUsing attributes (to add a link)
ch01-eg03.htmlHow white space is collapsed
ch01-eg04.htmlCreating headings using the hn elements
ch01-eg05.htmlStructuring headings and paragraphs
ch01-eg06.htmlThe align attribute
ch01-eg07.htmlCreating paragraphs using the <p> element
ch01-eg08.htmlCreating line breaks using the <br> element
ch01-eg09.htmlCreating preformatted text using the <pre> element
Try it outBasic Text Formatting

Presentation Elements

ch01-eg10.htmlUsing the <b> <i> <u> <s> and <tt> elements
ch01-eg11.htmlUsing the <sup> <sub> <big> <small> and <br /> elements

Phrase Elements

ch01-eg12.htmlAdding emphasis with the <em> and <strong> elements
ch01-eg13.htmlAbbreviations, acronyms and definitions using the <abbr> <acronym> and <dfn> elements
ch01-eg14.htmlQuotations and citations using the <blockquote> <quote> and <cite> elements
ch01-eg15.htmlCode using the <code> <kbd> <var> and <samp> elements
ch01-eg16.htmlAddresses using the <address> element

Lists

ch01-eg17.htmlUnordered lists using the <ul> and <li> elements
ch01-eg18.htmlOrdered lists using the <ol> and <li> elements
ch01-eg19.htmlDefinition lists using the <dl> <dd> and <dd> elements
ch01-eg20.htmlNesting lists

Editing text

ch01-eg21.htmlEditing text with the <ins> and <del> elements

Block and inline elements

ch01-eg22.htmlBlock level and inline elements