Tag Archive: HTML


HTML DOCTYPE Collection

from http://www.w3.org/QA/2002/04/valid-dtd-list.html

Recommended Doctype Declarations to use in your Web document.

When authoring document is HTML or XHTML, it is important to Add a Doctype declaration. The doctype declaration must be exact (both in spelling and in case) to have the desired effect, which makes it sometimes difficult. To ease the work, below is a list of recommended doctype declarations that you can use in your Web documents.

Template

Use the following markup as a template to create a new XHTML 1.0 document using a proper Doctype declaration. See the list below if you wish to use another DTD.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
	<title>An XHTML 1.0 Strict standard template</title>
	<meta http-equiv="content-type"
		content="text/html;charset=utf-8" />
</head>

<body>

     <p>… Your HTML content here …</p>

</body>
</html>

(X)HTML Doctype Declarations List

HTML 4.01
Strict
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
   "http://www.w3.org/TR/html4/strict.dtd">
Transitional
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">
Frameset
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
   "http://www.w3.org/TR/html4/frameset.dtd">
	
XHTML 1.0
Strict (quick reference)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
Transitional
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Frameset
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
XHTML 1.1DTD:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
   "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
	
XHTML Basic 1.1 (quick reference):
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.1//EN"
    "http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd">
	
HTML 5 [NOT a standard yet]
<!DOCTYPE HTML>

MathML Doctype Declarations

MathML 2.0DTD:
<!DOCTYPE math PUBLIC "-//W3C//DTD MathML 2.0//EN"
	"http://www.w3.org/TR/MathML2/dtd/mathml2.dtd">
	
MathML 1.01DTD:
<!DOCTYPE math SYSTEM
	"http://www.w3.org/Math/DTD/mathml1/mathml.dtd">
	

Compound documents doctype declarations

XHTML + MathML + SVGDTD:
<!DOCTYPE html PUBLIC
    "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN"
    "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd">
	
XHTML + MathML + SVG Profile (XHTML as the host language) – DTD:
<!DOCTYPE html PUBLIC
    "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN"
    "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd">
	
XHTML + MathML + SVG Profile (Using SVG as the host) – DTD:
<!DOCTYPE svg:svg PUBLIC
    "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN"
    "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd">
	

Optional doctype declarations

Beyond the specificities of (X)HTML processing, Doctype declarations in XML languages are only useful to declare named entities and to facilitate the validation of documents based on DTDs. This means that in many XML languages, doctype declarations are not necessarily useful.

The list below is provided only if you actually need to declare a doctype for these types of documents.

SVG 1.1 FullDTD:
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
	"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
	
SVG 1.0DTD:
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
	"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
	
SVG 1.1 BasicDTD:
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Basic//EN"
	"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-basic.dtd">
	
SVG 1.1 TinyDTD:
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN"
	"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
	

Historical doctype declarations

The doctype declarations below are valid, but have mostly an historical value — a doctype declaration of a more recent equivalent ought to be used in their stead.

HTML 2.0DTD:
<!DOCTYPE html PUBLIC "-//IETF//DTD HTML 2.0//EN">
HTML 3.2DTD:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
XHTML Basic 1.0DTD:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.0//EN"
    "http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd">
	

Useful HTML Meta Tags

Tag Name Example(s) Description
Author <META NAME=”AUTHOR” CONTENT=”Tex Texin”> The author’s name.
cache-control <META HTTP-EQUIV=”CACHE-CONTROL” CONTENT=”NO-CACHE”> HTTP 1.1. Allowed values = PUBLIC | PRIVATE | NO-CACHE | NO-STORE.
Public – may be cached in public shared caches
Private – may only be cached in private cache
no-Cache – may not be cached
no-Store – may be cached but not archivedThe directive CACHE-CONTROL:NO-CACHE indicates cached information should not be used and instead requests should be forwarded to the origin server. This directive has the same semantics as the PRAGMA:NO-CACHE.
Clients SHOULD include both PRAGMA:NO-CACHE and CACHE-CONTROL:NO-CACHE when a no-cache request is sent to a server not known to be HTTP/1.1 compliant.
Also see EXPIRES.
Note: It may be better to specify cache commands in HTTP than in META statements, where they can influence more than the browser, but proxies and other intermediaries that may cache information.
Content-Language <META HTTP-EQUIV=”CONTENT-LANGUAGE”
CONTENT=”en-US,fr”>
Declares the primary natural language(s) of the document. May be used by search engines to categorize by language.
CONTENT-TYPE <META HTTP-EQUIV=”CONTENT-TYPE”
CONTENT=”text/html; charset=UTF-8″>
The HTTP content type may be extended to give the character set. It is recommended to always use this tag and to specify the charset.
Copyright <META NAME=”COPYRIGHT” CONTENT=”&copy; 2004 Tex Texin”> A copyright statement.
DESCRIPTION <META NAME=”DESCRIPTION”
CONTENT=”…summary of web page…”>
The text can be used when printing a summary of the document. The text should not contain any formatting information. Used by some search engines to describe your document. Particularly important if your document has very little text, is a frameset, or has extensive scripts at the top.
EXPIRES <META HTTP-EQUIV=”EXPIRES”
CONTENT=”Mon, 22 Jul 2002 11:12:01 GMT”>
The date and time after which the document should be considered expired. An illegal EXPIRES date, e.g. “0″, is interpreted as “now”. Setting EXPIRES to 0 may thus be used to force a modification check at each visit.
Web robots may delete expired documents from a search engine, or schedule a revisit.HTTP 1.1 (RFC 2068) specifies that all HTTP date/time stamps MUST be generated in Greenwich Mean Time (GMT) and in RFC 1123 format.
RFC 1123 format = wkday “,” SP date SP time SP “GMT”

wkday = (Mon, Tue, Wed, Thu, Fri, Sat, Sun)
date = 2DIGIT SP month SP 4DIGIT ; day month year (e.g., 02 Jun 1982)
time = 2DIGIT “:” 2DIGIT “:” 2DIGIT ; 00:00:00 – 23:59:59
month = (Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec)

Keywords <META NAME=”KEYWORDS”
CONTENT=”sex, drugs, rock & roll”>
The keywords are used by some search engines to index your document in addition to words from the title and document body. Typically used for synonyms and alternates of title words. Consider adding frequent misspellings. e.g. heirarchy, hierarchy.
PRAGMA NO-CACHE <META HTTP-EQUIV=”PRAGMA” CONTENT=”NO-CACHE”> This directive indicates cached information should not be used and instead requests should be forwarded to the origin server. This directive has the same semantics as the CACHE-CONTROL:NO-CACHE directive and is provided for backwards compatibility with HTTP/1.0.
Clients SHOULD include both PRAGMA:NO-CACHE and CACHE-CONTROL:NO-CACHE when a no-cache request is sent to a server not known to be HTTP/1.1 compliant.
HTTP/1.1 clients SHOULD NOT send the PRAGMA request-header. HTTP/1.1 caches SHOULD treat “PRAGMA:NO-CACHE” as if the client had sent “CACHE-CONTROL:NO-CACHE”.
Also see EXPIRES.
Refresh <META HTTP-EQUIV=”REFRESH”
CONTENT=”15;URL=http://www.I18nGuy.com/index.html”>
Specifies a delay in seconds before the browser automatically reloads the document. Optionally, specifies an alternative URL to load, making this command useful for redirecting browsers to other pages.
ROBOTS <META NAME=”ROBOTS” CONTENT=”ALL”>

<META NAME=”ROBOTS” CONTENT=”INDEX,NOFOLLOW”>

<META NAME=”ROBOTS” CONTENT=”NOINDEX,FOLLOW”>

<META NAME=”ROBOTS” CONTENT=”NONE”>

CONTENT=”ALL | NONE | NOINDEX | INDEX| NOFOLLOW | FOLLOW | NOARCHIVE
default = empty = “ALL”
“NONE” = “NOINDEX, NOFOLLOW”
The CONTENT field is a comma separated list:
INDEX: search engine robots should include this page.
FOLLOW: robots should follow links from this page to other pages.
NOINDEX: links can be explored, although the page is not indexed.
NOFOLLOW: the page can be indexed, but no links are explored.
NONE: robots can ignore the page.
NOARCHIVE: Google uses this to prevent archiving of the page. See http://www.google.com/bot.html
GOOGLEBOT <META NAME=”GOOGLEBOT” CONTENT=”NOARCHIVE”> In addition to the ROBOTS META Command above, Google supports a GOOGLEBOT command. With it, you can tell Google that you do not want the page archived, but allow other search engines to do so. If you specify this command, Google will not save the page and the page will be unavailable via its cache.
See Google’s FAQ.

Anchor in HTML

Just a note of different anchors as following:

  1. href=’#’ will function the same as scroll to the top. This just draw me another attention that DO NOT put # in you file name!
  2. href=’?’ will trigger the browser to refresh the same page. just a shorter coding if you don’t want to type the whole url.
  3. href=’javascript:void(0)’ will do nothing. the same meaning as href=’javascript: return false;’.
Powered by WordPress. Theme: Motion by 85ideas.