What HTML am I using?

I’m reading the DOCTYPE section of “Build Your Own Website the Right Way…” It tells me that the DOCTYPE should tell what HTML or XHTML version I am using. How do I know what HTML or XHTML version I am using?

I am in the process of creating a website for someone. My client was happy yesterday. Today things are messed up in his PC but okay looking in my Mac. We are both using Firefox. The only thing I can think of is that some changes were made in the DOCTYPE information that his browser retrieved.

I’m all confused. How do I know what DOCTYPE rule to use?

The HTML 4 strict doctype is the most appropriate one for new web sites (unless you have a specific reason for wanting to use the XHTML 1.0 strict one instead). The transitional doctypes are for use with old web pages that still haven’t finished updating to get rid of all the old tags that are no longer part of HTML.

Check out - http://www.w3schools.com/tags/tag_DOCTYPE.asp

The declared doctype will have effects - even declaration of ‘strict’’ and ‘‘loose’’ can affect things IIRC.

If you are using straightforward html4 and css then a pretty safe doctype IMO can be …

<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN”>

I choose rarely to employ xml myself which if used with an xhtml strict declaration can prove problematic and make validation tricky - I am not guru status BTW - so a more informed opinion may well come along. W3schools is a mine of info and i think some reading there will help you.

To add - oops, beaten by the guru!!  I guess transitional suits me because working on an old site this does seem appropriate.  New site different.

Exactly. The transitional doctypes are there so that sites originally written using HTML 3.2 can be gradually updated to HTML 4. If it starts out using HTML 4 then you don’t need transitional.

Unless you have a specific reason for considering XHTML or the HTML 5 preliminary draft you can ignore those variants and should start out with the current HTML 4 standard.

How do you know what language you wrote your post in? (It was English, by the way.)

First you decide what HTML to use (normally HTML 4.01 Strict), then you write your markup abiding to those rules.

You don’t write a novel first and then decide whether it is in English or French, right? Your approach seems completely backward to me.