4umi.com/web/html/snips

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.

Doctypes

  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">

Template

Syntax highlight the code.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd">
<html><head><title></title>
<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; }
</style>
<script type="text/javascript">
</script>
</head><body>
 
</body></html>

Links

<a href="http://" title=""
 accesskey="" tabindex=""
 onclick="return window.confirm( 'Really?' );"
 onmouseover="" onfocus=""
 onmouseout="" onblur=""
>
</a>
<a href="mailto:Some%20Name%20<some@example.com>">
  an email with pre-filled name
</a>
<a href="mailto:Some%20Name%20<some@example.com>?subject=An%20example">
  an email with prefilled name and subject line
</a>
<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
</a>

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

Elements

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

Disable IE6 image toolbar

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

Reference