Writing and validating a transitional XHTML document
This tutorial is aimed towards Windows users. If you are using another operating system, follow the same instructions using whatever text editor and web browser is available to you.
The transitional document type is the one you really need if your webpage will contain some deprecated features such as the <font> tag and will NOT consist of frames. If this is not the case, then you need one of the other document types (frameset or strict).
Read more about the different XHTML document types at our XHTML document types tutorial.
Transitional document step-by-step
Open notepad by going to Start -> Programs -> Accessories -> Notepad OR go to Start -> Run - Type notepad and press Enter.
Type in this code:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/ xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Transitional document</title> </head> <body> This is a transitional XHTML document. </body> </html>
- Go to File -> Save -> Click on the 'Save as Type' drop down box and select 'All Files'. Save the file as transitional.html to a directory of your choice (for easy access, the desktop is recommended).
- Open your web browser and go to File -> Open -> navigate to your file and open it.
You should now see an XHTML transitional document in your web browser which looks like this:
The validation process
You've written a transitional XHTML document, now lets validate it!
- Go to the W3C Markup Validator, located at http://validator.w3.org.
- The W3C Markup Validator gives you the option of validating a document by URL, by File Upload, or by Direct Input. You will be validating the document by File Upload so click on the tab that says "Validate by File Upload" and upload the file. When you are ready to validate click on the button that says "Check"
- If the document did not validate, you will get an error message stating this. The Markup Validator provides a detailed description of the error(s) so you know what went wrong. Possible errors include missing closing tags, tags not closed in the right order, attribute values not quoted properly, a missing <!DOCTYPE> declaration, among others.
- Once your document validates.....you now have a valid XHTML transitional document!! This means "that you have taken the care to create an interoperable Web page" as is stated by the W3C Markup Validator.