Bits and pieces

Useful HTML

A collection of markup code snippets I often wish I had on the clipboard. So here they are, ready for a million copies.


  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  3. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  4. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
  5. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  6. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  7. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">


Syntax highlight the code.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<meta name="description" value="ca. 200 characters, 25 words">
<meta name="keywords" value="ca. 1000 characters, 150 words">
<link href="" rel="stylesheet" type="text/css">
<style type="text/css">
a { text-decoration: none; }
a:hover { text-decoration: underline; }
<script type="text/javascript">


<a href="http://" title=""
 accesskey="" tabindex=""
 onclick="return window.confirm( 'Really?' );"
 onmouseover="" onfocus=""
 onmouseout="" onblur=""
<a href="mailto:Some%20Name%20<some@example.com>">
  an email with pre-filled name
<a href="mailto:Some%20Name%20<some@example.com>?subject=An%20example">
  an email with prefilled name and subject line
<a href="mailto:Some%20Name%20<some@example.com>?cc=Some%20More%20<copy@example.com>&bcc=blindcopy@example.com&subject=An%20example&body=Here%20is%20the%20message.%0d%0aBye%20now.">
  an email with prefilled names, addresses, subject line and body

The last code produces a link to an email with prefilled name, addresses, subject line and body.


<table cellpadding="0" cellspacing="0" border="0"><tbody><tr valign="top">
<select onchange="">
 <option value="">
 <option value="">

Disable IE6 image toolbar

per page:
<meta http-equiv="imagetoolbar" content="no">
or per image:
<img src="test.gif" galleryimg="no">