HTML/XHTML

From HalfgeekKB
Jump to navigation Jump to search

XHTML 1.1 Heading

<?xml version="1.0" encoding="utf-8" ?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

XHTML validator link

<a href="http://validator.w3.org/check?uri=referer">
  <img src="http://www.w3.org/Icons/valid-xhtml11" alt="Valid XHTML 1.1" height="31" width="88" /></a>

CSS validator link

<a href="http://jigsaw.w3.org/css-validator/check/referer">
  <img src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS" /></a>

Include stylesheet

<link href="styles.css" rel="stylesheet" type="text/css" />

Include script

<script type="text/javascript" src="script.js"></script>

Favorites icon

<link rel="icon" type="image/x-icon" href="favicon.ico" />
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico" />

It also appears to happen automatically given a file "favicon.ico" in the root.

Values for rel attribute of <link>

  • alternate
  • appendix
  • bookmark
  • chapter
  • contents
  • copyright
  • glossary
  • help
  • home
  • index
  • next
  • prev
  • section
  • start
  • stylesheet
  • subsection

HTML Redirect

<meta http-equiv="refresh" content="5;URL=http://example.com" />