HTML/XHTML

Posts about HTML.

Using The view-source Protocol

Thursday, August 28, 2008 - 10:43

If you are running FireFox (or Chrome) then there is a handy little short cut you can use to view the source of a page you are looking at. If you add the text view-source on any web address then you will see the equivalent of viewing the source of a page (perhaps by pressing Ctrl+u). Although not entirely useful, it does have a couple of benefits, such as being able to view your code in another tab, rather than another window.

Category: 

HTML And XHTML Doctypes

Monday, June 23, 2008 - 10:08

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.

Category: 

HTML Meta Refresh

Thursday, May 22, 2008 - 09:42

To get a webpage to refresh every few seconds you can use a meta tag with the attribute http-equiv and a value of refresh. The number of seconds to delay can be put into the content attribute. This meta tag (as will all meta tags) goes into the head section of the document.

Here is an example that refreshes the page every 2 seconds.

<meta http-equiv="refresh" content="2" />

It is also possible to make the browser refresh to another page by including the string:

Category: 

External JavaScript Include In HTML

Wednesday, December 26, 2007 - 13:32

To include a JavaScript file into a HTML page you can use the script tag with the src parameter pointing towards the source code file. However, there is a subtle difference between the script tag in HTML and XHTML. This is because the language attribute is not supported in XHTML, so if you just copy the code from HTML to XHTML the page won't validate. The solution here is to just leave it out.

For HTML.

Category: 

Linking An RSS Or Atom Feed to a HTML Document

Thursday, December 20, 2007 - 16:17

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.

Category: