The importance of the Doctype
HTML follows certain rules-these rules are contained in a Document Type definition file, otherwise known as a DTD. A DTD is an XML document that explains what tags, attributes, and values are valid for a particular type of HTML. And for each version of HTML, there’s a corresponding DTD. By now you may be asking, “But what’s all this got to do with CSS?”
Everything, if you want your Web design <a href="https://http://www.sempro.ca/optimization.asp" target="_blank">http://www.sempro.ca/optimization.asp</a> search engine optimization to appear correctly and consistently in Web browsers. You tell a Web browser which version of HTML or XHTML you’re using by including what’s called a doctype declaration at the beginning of a Web page. This doctype declaration is the first line in the HTML file and not only defines what version of HTML you’re using but also points to the appropriate DTD file out on the Web. When you mistype the doctype declaration, you can throw most browsers into an altered state called quirks mode.
Quirks mode is browser manufacturers’ attempts to make their software behave like browsers did circa 1999. If a modern browser encounters a page that’s missing the correct doctype, then it thinks “Gee, this page must have been mwritten a long time ago, in an HTML editor far, far away. I’ll pretend I’m a really old browser and display the page just as one of those buggy old browsers would display it.” That’s why, without a correct doctype, your lovingly CSS-styled Web page may not look as they should, according to current standards. If you unwittingly view your Web page in quirks mode when checking it in a browser, you may end up trying to fix display problems that are related to an incorrect doctype and not the incorrect use of HTML or CSS.
Fortunately, it’s easy to get the doctype correct. All you need to know is what version of HTML you’re using. In all likelihood, you’re already creating Web pages using HTML 4. You may even have started using XHTML for your Web sites.
The most popular versions of HTML and XHTML these days are HTML 4.01 Transitional and XHTML 1.0 Transitional. These types of HTML still let you use presentational tags like the tag, thereby providing a transition from older HTML to the newer, stricter type of HTML and XHTML. Although it’s best not to use these tags at all, they still work in the Transitional versions, so you can phase out these older tags at your own pace. In the strict versions of HTML and XHTML, some older tags don’t work at all.
If this entire discussion is making your head ache and your eyes slowly shut, just make sure you use the proper doctype listed above, and always make it the first line of your HTML file. If you want a basic template to use when building either HTML or XHTML pages.
Article Source: https://www.bharatbhasha.com
Article Url: https://www.bharatbhasha.com/search-engine-optimization.php/72134
Article Added on Friday, March 21, 2008
|SEOptimization >> Top 50 Articles on SEOptimization|
|Category - >|