When creating web pages and pages for mobile devices, it's a good idea to include a Doctype declaration in your files to ensure compliance with established standards. When it comes to web browsers, they'll pretty much display your web pages regardless of whether you include this information or not, but the same is not so true of mobile devices which have adopted stricter guidelines. If you want to use an online HTML validator, you must include a !DOCTYPE declaration at the beginning of the HTML code, as shown in Figure 35.5, so the validator knows what to check your code against. The GoLive syntax checker also checks your document against the doctype you specify.
Figure 35.5. The !DOCTYPE declaration tells validators and browsers that your code is conforming to that particular Document Type Description (DTD).
By indicating a document's doctype, you are specifying that the document complies with a particular Document Type Description (DTD). The DTDs can sometimes limit the type of code allowed. For example, the HTML 4.0 Strict DTD does not allow the use of frames, and you can't use font tags in the XHTML Basic DTD. Many cell phone manufacturers require the XHTML Basic doctype for all mobile content. Eventually all browsers will likely require compliance with some DTD, so it's a good idea to familiarize yourself with them now. You can find everything you need to know about DTDs at the World Wide Web Consortium website (www.w3.org). Other good sources of information for web developers on the web also offer great explanations of DTDs, such as www.alistapart.com/articles/doctype/ or www.webmonkey.com. Visit these sites and use their search engines to search for DTD.