The W3 Consortium offers an
online
validator for the various HTML dialects. It is sort of a Lint for HTML. It can ensure your HTML will work properly on browsers other than the one you tested it on. The W3C
consortium also controls the various HTML standards.
For speed, and control, I use
CSE HTMLValidator to check my web pages off-line and in batches.
When it comes to HTML4, and CSS style sheets, browser support is shaky. TopStyle will help you keep track of which features work on which browsers.
| Use of CSS class | ||
|---|---|---|
| Start Tag | End Tag | description |
| <span class="strawberry"> | </span> | encloses text of the strawberry class. The browser will look in the style sheet to figure out what attributes should be applied to strawberry text, perhaps a size, colour, alignment, font etc. |
| <div class="strawberry sweet"> | </div> | Applying two classes to the same tag. This applies both the classes strawberry and sweet to a group of lines. The browser will look in the style sheet to figure out what attributes should be applied to strawberry and to sweet text, perhaps a size, colour, alignment, font etc. Note they are separated by a space not a comma! |
| <ul class="strawberry"> | </ul> | like a regular UL except everything in it is should be treated as strawberry text. |
| Groups, Lists, Glossaries | ||
|---|---|---|
| Start Tag | End Tag | description |
| <ol> | </ol> | ordered numbered list |
| <ul> | </ul> | unordered bulleted list. Consider using a borderless table with column of titles and a column of detail instead. The bullets themselves don’t give much additional information. |
| <menu> | </menu> | menu list, more compact than ul. |
| <li> | </li> | list item |
| <dl> | </dl> | dictionary list |
| <dt> | </dt> | dictionary term being defined |
| <dd> | </dd> | dictionary definition |
| Line Breaks | |
|---|---|
| Tags | description |
| <br>
or <br /> |
new line, no extra space.
To prepare for XHTML, it is better to use <br />. |
| <br clear="all" /> | gets past any flow-around illustration. |
| <p>
or <p>…</p> |
new paragraph, blank line inserted.
To prepare for XHTML, it is better to use <p>…</p> surrounding each paragraph. |
| <p align="center">…</p> | centre each line |
| <hr>
or <hr /> |
horizontal rule
To prepare for XHTML, it is better to use <hr /> |
| Font Colours and Size | |||
|---|---|---|---|
| Start Tag | End Tag | Appearance | Description |
| <h1> | </h1> | sample |
major heading |
| <h6> | </h6> | sample |
most minor heading |
| <b> | </b> | sample | bold, c.f. strong |
| <i> | </i> | sample | italic, c.f. em |
| <tt> | </tt> | sample | typewriter font |
| <pre> | </pre> | sample |
preformatted |
| <font size="+3"> | </font> | sample | or 3 for absolute size rather than increase |
| <font color="red"> | </font> | sample | see choice of colours. |
| <font face="Comic Sans MS,Helvetica,sanserif"> | </font> | sample | suggest a typeface. User must have it installed, can specify alternates in order of preference. You should end with one of the CSS default fonts serif, sansserif or monospace. |
| <big> | </big> | sample | shorthand for <font size="+1"> |
| <small> | </small> | sample | shorthand for <font size="-1"> |
| <dfn> | </dfn> | sample | definition |
| <em> | </em> | sample | emphasis, usually renders as italic. |
| <cite> | </cite> | sample | book titles |
| <code> | </code> | sample |
program listings |
| <kbd> | </kbd> | sample | keystrokes |
| <samp> | </samp> | sample | computer status messages |
| <sup> | </sup> | 2 | superscript. You can also use entities like ² ² |
| <strong> | </strong> | sample | strong emphasis, usually rendered as bold. |
| <var> | </var> | sample | to be replaced by specific when used. Typically rendered in italics. |
| <u> | </u> | sample | underline |
| <address> | </address> | sample | email address, possibly street address. |
| <blockquote> | </blockquote> | sample |
long quotation |
Comments are not treated as white space. e.g. grand<!-- a comment in the middle of a word -->stand will render as grandstand not grand stand.
<h2><a name="GLOSSARY"></a>Roedy’s Java Glossary</h2>Rules for making up anchor names:
Click any ball to view the corresponding colour palette.
<ul> ... </ul>Happily, the technique also nests properly.
The official way is to use CSS styles.
<div style="padding-left: 30px"> ... </div>If you want to pad all paragraphs, put this in the "head" section or in the style sheet.
<style type="text/css"> p {padding-left: 30px} </style>Or do this:
<style type="text/css"> p.leftpad {padding-left: 30px} </style>and then it will only indent subsequent paragraphs that are marked like this:
<p class="leftpad"> ... </p>
Unfortunately, the technique does not handle nesting. <div> does however.
To indent just the first line of each paragraph, use:
<p style="text-indent: 30px">
I like to create my web pages with a text editor , but if you want a tool to help you compose HTML in a more WYSIWYG style try one of these:
The entities such as ÷✓ only work in HTML, not Java. In Java, you get at the exotic characters by encoding them in hex in your strings like this: "\u00f7\u2713" to produce ÷ ✓. See String literals for more details.
For official set of W3C entities see this definitive list of entities. Please tell me about any omissions in my own tables. Last revised/verified: 2005-06-24
The header, link, meta and body tags have the following purposes:
| Body Tags | |
|---|---|
| Field | Function |
| BGCOLOR | background RGB in hex |
| BACKGROUND | *.gif to use as background tiled. For repeating backgrounds, it is best to make the *.gif 25 pixels high even if in theory 1 pixel would do. That speeds rendering even though it slows download. |
| TEXT | ordinary text colour |
| LINK | clickable links not yet visited |
| VLINK | links that have already been visited |
| ALINK | active link text, what you just clicked. |
| MARGINHEIGHT | pixels in border top/bottom. |
| MARGINWIDTH | pixels in border left/right. |
| HTML Used Only In Emails | |
|---|---|
| HTML | Purpose |
<x-sigsep> <p> </x-sigsep> |
Separates body from the signature. |
| Indicates some text in your email, in this case http://mindprod.com/ that looked to Eudora like a URL, that it has automatically converted into a link. | |
<blockquote type="cite" class="cite" cite> ... </blockquote> |
Used for quoting in replies. Rendered as nested vertical bars down the left margin. |
| An embedded, as opposed to attached, image. The image itself is made into a hidden attachment that is base64 encoded. HTML email cannot presume web access when mail is written, so ordinary <img tags can’t be used. | |
![]() |
and suggestions to improve this page to Roedy Green : | ||
| Canadian Mind Products | |||
| mindprod.com IP:[65.110.21.43] | |||
| Your face IP:[38.103.63.58] | |||
| You are visitor number 156,440. | |||
| You can get a fresh copy of this page from: | or possibly from your local J: drive (Java virtual drive/mindprod.com website mirror) | ||
| http://mindprod.com/jgloss/htmlcheat.html | J:\mindprod\jgloss\htmlcheat.html | ||