(X)HTML

HTML Logo

HTML And XHTML Doctypes

23rd June 2008 - 3 minutes read time

In order to validate any page of HTML or XHTML you will need a doctype. This is a string of text that sits at the top of the document and tells the browser exactly what markup standard has been used to create the page.

XHTML Strict

This doctype is used in an XHTML document when you are not using any framset or depreciated tags.

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

XHTML Transitional

This doctype is used if your XHTML document contains depreciated tags like <b>.<.p>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

XHTML Frameset

Use this XHTML doctype if your document contains either frameset tags or depreciated tags, or both.

HTML Logo

Linking An RSS Or Atom Feed to a HTML Document

20th December 2007 - 1 minute read time

Adding a hyper link for an RSS or Atom feed on your web page works, but that's not all you can do. By adding a link to the head section of the page you can allow your users an alternative method of picking up your feed.

To add an RSS feed use this.

<link rel="alternate" type="application/rss+xml" href="http://www.example.com/rssfeed.xml" />

To add an Atom feed use this.

<link rel="alternate" type="application/atom+xml" href="http://www.example.com/blog/wp-atom.php" />

These are both XHTML examples. To do this in HTML just remove the slash on the right hand side like this.