The Breakdown
Every HTML document should start with a
<!DOCTYPE>
declaration that tells the browser what version of HTML the document is written in. The <!DOCTYPE>
required by HTML5 documents is much shorter than those that came before.Minimal HTML
Introduction
There are a lot of Web pages that aren't worth the time spent loading them. This is in part due to the inexperience of Web page creators; HTML provides designers with a rich set of tools, but little guidance on how to use them effectively. This page is a small attempt to correct this problem, by introducing a practice I call Minimal HTML.
Minimal HTML combines a subset of HTML elements from the HTML 3.2 specification with rules for their use. Its aim is to teach the art of creating Web pages worth reading. To this end, Minimal HTML throws away the parts of the HTML 3.2 specification that deal with presentation, focusing instead on document structure and content. By paying more attention to content, your pages will be more useful to your visitors. Always keep this in mind: search engines index content, not design. By improving content, you increase the chance that people will find and benefit from your creations.
I encourage you to try Minimal HTML. Create a Web page or two, or rewriting existing ones, following its guidelines. Once you've mastered this practice, you should have a better understanding of what is truly important in Web page design.
The Rules of Minimal HTML
Minimal HTML has four types of guidelines: required, allowed, restricted, and forbidden. These types indicate how a given element is to be used. For example, the
<!DOCTYPE>
element is required, so it must appear in a page's HTML. Header elements (<hx>
) are restricted, which means that they may appear so long as the associated rule is followed.Note that these are guidelines, and may be ignored in exceptional cases. For example, the prohibition of physical markup tags may be broken when notating equations.
Required
- The page must begin with
<!DOCTYPE>
, which must declare a DTD. The page should validate against that DTD. (For Minimal HTML, we choose the HTML 3.2 DTD.) - The
<html>
,<head>
, and<title>
elements. - The
<body>
element must be present, although its attributes are forbidden. - A
<meta>
element giving the page's character encoding. - Page content must begin with anThese first five rules can be turned into a Web page template.
<h1>
element containing the page's title. - Elements may only occur inside appropriate containers (e.g.,
<li>
may appear only inside<ul>
or<ol>
).
Allowed
- Semantic text markup tags (
<address>
,<cite>
,<code>
,<dfn>
,<kbd>
,<samp>
,<var>
) - Links (
<a>
). Note that theTARGET
attribute is not a part of HTML 3.2, and should not be used. - Meta-information (
<meta>
and<link>
) - Images if they are indispensable;
alt
,width
, andheight
attributes are mandatory. - Logical text markup (
<em>
,<strong>
, et cetera); use sparingly. - Forms.
- Preformatted text (
<pre>
). - Non-numeric HTML 3.2 entities (e.g.,
©
).