HTML text examples

This file contains all of the code examples from the "Marking up textual content in HTML" article, so you can see a live example of how all the source code renders in a browser.

Whitespace example

In the beginning

Headings example

Marking up Textual Content in HTML

Introduction

Space—the final frontier

Block level elements

Page section headings

Generic paragraphs

Quoting other sources

Preformatted text

Inline elements

[…and so on…]

Paragraph example

This is a very short paragraph. It only has two sentences.

Quoting other sources example

HTML 4.01 is the only version of HTML that you should use when creating a new web page, as, according to the specification:

This document obsoletes previous versions of HTML 4.0, although W3C will continue to make those specifications and their DTDs available at the W3C Web site.

Preformatted example


            # read in the named file in its entirety
            sub slurp {
                my $filename = shift;
                my $file     = new FileHandle $filename;
                
                if ( defined $file ) {
                    local $/;
                    return <$file>;
                }
                return undef;
            };
        

Inline quote example

This did not end well for me. Oh well, c'est la vie as the French say.

Emphasis example

Please note: the kettle is to be unplugged at night.

Emphasis and strong example

Please note: the kettle must be unplugged every evening, otherwise it will explode - killing us all.