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 remember to unplug the kettle at night.

Italic examples

As we sailed into port, we spied the Black Pearl moored at the dock.

Book: Living with a Diminutive Stature, Bruce Lawson, Peachpit Press, published , ISBN 999-0-388-99999-6

She really does add that little bit of je ne sais quoi.

Strong example

There are a total of twenty different species living inside this enclosure. Warning: Do not feed them: they will eat your shoes.

Bold example

In this article, Chris Mills will show you how to combine HTML5, CSS3, coloured card and string to create an attractive mobile for your child's bedroom.

Emphasis and strong example

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

Small print

This content is released under a Creative Commons Attribution Share-alike license.

Telling the time

I was born on the .

.

.

.

.

Published on .