* HTML/CSS Test Page For Web Designers

Erik’s Clueful HTML Brain Dump.

Erik J. Heels

Below is just about everything you’ll need to style a WordPress theme (or any other CSS-based web design). Check the source code (i.e. view source) to see the many embedded elements within paragraphs. This page is based on the WordPress Twenty Ten HTML test page. But I changed a bunch of stuff to make it more clueful (at least to me). Because I still write HTML by hand. In a text editor. So sue me.

First came HTML, and it was simple. It had content, it had format. Then came CSS, and it was not so simple. Remember when web pages used to look the same on screen and on paper? Yeah, those days are gone. Thanks, CSS! And so content and format split, content stayed with HTML, format went with CSS. With the content/format split of HTML/CSS, however, many website designers forgot this basic rule: Websites with custom CSS should look at least as good as the corresponding raw HTML.

So here are screen shots of the raw HTML of this page, displayed in Firefox 17.0.1 under OS X 10.8.2 (Mountain Lion). If you’re doing any CSS-based design work, then start with the look-and-feel of the raw HTML and improve on it, but don’t leave any HTML elements out (sheesh).

H1 = Heading 1

This is a paragraph (<P>). IMHO, it makes sense to have vertical spacing between header elements and paragraphs.

This is also a paragraph.

Line 1: This is a paragraph with four lines but:
Line 2: It has self-terminating
Line 3: line breaks (<br />) at
Line 4: the end of every line.

You might want to use the <br /> tag for multi-line list items like this:

Related Posts:

H2 = Heading 2

This is a paragraph. IMHO, it makes sense to have vertical spacing between header elements and paragraphs.

This is also a paragraph.

H3 = Heading 3

This is a paragraph. IMHO, it makes sense to have vertical spacing between header elements and paragraphs.

This is also a paragraph.

H4 = Heading 4

This is a paragraph. IMHO, it makes sense to have vertical spacing between header elements and paragraphs.

This is also a paragraph.

H5 = Heading 5 (I don’t think I’ve ever used this; I think that headings should be bigger than the corresponding text)

This is a paragraph. IMHO, it makes sense to have vertical spacing between header elements and paragraphs.

This is also a paragraph.

H6 = Heading 6 (I don’t think I’ve ever used this; I think that headings should be bigger than the corresponding text)

This is a paragraph. IMHO, it makes sense to have vertical spacing between header elements and paragraphs.

This is also a paragraph.

Lorem ipsum dolor sit amet, this is a link adipiscing elit. This is <STRONG>. Nullam dignissim convallis est. Quisque aliquam. This is emphasized (<EM>). Donec faucibus. Nunc iaculis suscipit dui. 53 = 125 (that’s a superscript (<SUP>)). Water is H2O (that’s a subscript (<SUB>)). Nam sit amet sem. Aliquam libero nisi, imperdiet at, tincidunt nec, gravida vehicula, nisl. The New York Times (that’s a citation (<CIT>)). This is (<SPAN>) and text-decoration:underline). Maecenas ornare tortor. Donec sed tellus eget sapien fringilla nonummy. Mauris a ante. Suspendisse quam sem, consequat at, commodo vitae, feugiat in, nunc. Morbi imperdiet augue quis tellus.

HTML (that’s an abbreviation (<ABBR>)) and CSS (that’s an abbreviation (<ABBR>)) are our tools. Mauris a ante. Suspendisse quam sem, consequat at, commodo vitae, feugiat in, nunc. Morbi imperdiet augue quis tellus. Praesent mattis, massa quis luctus fermentum, turpis mi volutpat justo, eu volutpat enim diam eget metus. To copy a file type COPY (this is <CODE>) filename (this is <VAR> inside of <CODE>). Dinner’s at 5:00 (this is <DEL>). Let’s make that 7 (this is <INS>). This text (this is <SPAN> and text-decoration:line-through) has been struck.

Below this paragraph, there should be a horizontal rule (<HR />).


Above this paragraph, there should be a horizontal rule (<HR />), which I like to call “horizontal line.”

List Types

Definition List (<DL>) (I don’t think I’ve ever used this)

Definition List Title (<DT>)
This is a definition list division (<DD>).
Definition (<DT>)
An exact statement or description of the nature, scope, or meaning of something: our definition of what constitutes poetry (<EM>).

Ordered List (<OL>)

  1. List Item 1 (<LI>)
  2. List Item 2
    1. Nested list item A (NB: numbering should make sense)
    2. Nested list item B
  3. List Item 3

Unordered List (<UL>)

  • List Item 1
  • List Item 2
    • Nested list item A (NB: bullets should make sense)
    • Nested list item B
  • List Item 3

Table Without Borders (<table>)

Table Header 1 (<TH>) Table Header 2 Table Header 3
Table Data 1 (<TD>) Table Data 2 Table Data 3
Table Data 1 Table Data 2 Table Data 3
Table Data 1 Table Data 2 Table Data 3

Table With Border=1 (<table>)

Table Header 1 (<TH>) Table Header 2 Table Header 3
Table Data 1 (<TD>) Table Data 2 Table Data 3
Table Data 1 Table Data 2 Table Data 3
Table Data 1 Table Data 2 Table Data 3

Table With Border=1 Align=”Center” (<table>)

Table Header 1 (<TH>) Table Header 2 Table Header 3
Table Data 1 (<TD>) Table Data 2 Table Data 3
Table Data 1 Table Data 2 Table Data 3
Table Data 1 Table Data 2 Table Data 3

Below this paragraph, there should be a horizontal rule (<HR />).


Above this paragraph, there should be a horizontal rule (<HR />), which I like to call “horizontal line.”

Preformatted Text

Typographically, preformatted text is not the same thing as code. Sometimes, a faithful execution of the text requires preformatted text that may not have anything to do with code. Most browsers use Courier and that’s a good default — (that’s a long dash (&8212;) – long dashes are evil, just like curly quotes) with one slight adjustment, Courier 10 Pitch over regular Courier for Linux users. For example:

"Beware the Jabberwock, my son! (this is <PRE>)
    The jaws that bite, the claws that catch!
Beware the Jubjub bird, and shun
    The frumious Bandersnatch!"

Code

Code can be presented inline, like <?php bloginfo('stylesheet_url'); ?> (this is <CODE>), or within a <pre> block. Because we have more specific typographic needs for code, we’ll specify Consolas and Monaco ahead of the browser-defined monospace font.

#container {
	float: left;
	margin: 0 -240px 0 0;
	width: 100%;
}

Below this paragraph, there should be a horizontal rule (<HR />).


Above this paragraph, there should be a horizontal rule (<HR />), which I like to call “horizontal line.”

Blockquotes

Let’s keep it simple. Italics are good to help set it off from the body text (and italic Georgia is lovely at this size). Be sure to style the citation.

Good afternoon, gentlemen. I am a HAL 9000 computer. I became operational at the H.A.L. plant in Urbana, Illinois on the 12th of January 1992. My instructor was Mr. Langley, and he taught me to sing a song. If you’d like to hear it I can sing it for you (This is <P> within <BLOCKQUOTE>).

HAL 9000

One more example:

“It doesn’t take all types, there just are all types.”
     – Thomas L. Bohan Winston Churchill (this is <small> within <blockquote> with five non-breaking spaces (&nbsp;) for good measure)

This is the final paragraph, not to be confused with The Final Countdown.


Erik J. Heels is a trademark and patent lawyer, Boston Red Sox fan, MIT engineer, and musician. He blogs about technology, law, baseball, and rock ‘n’ roll at erikjheels.com.