What Are the Different DTDs in XHTML?

104 8

    DOCTYPE Declaration - DTD

    • DTD is the first item of code that appears on a web page. Each doctype declaration identifies whether it's strict, transitional or frameset. For example, the following string is from the DTD code: "-//W3C//DTD XHTML 1.0 Transitional//EN." Located between the "W3C" and "EN" is the type of DTD, which is XHTML 1.0 Transitional. For strict DTD or frameset DTD, replace the word "transitional" with "Strict" or "Frameset." Memorizing these isn't necessary because many web applications automatically insert them at the beginning of an HTML document. The DTD contains instructions for the browser about how to display the web pages.

    Strict DTD - XHTML

    • The strict document type declaration informs Web browsers that Web pages contain only acceptable XHTML markup language. Use of either deprecated elements or deprecated attributes will prevent Web pages from loading properly. This is because those elements and attributes are no longer used in XHTML. For instance, font styles such as <u></u> for underlining text, are acceptable when using HTML 4.01, but not recognized with XHTML. Underlining text can only be done in the cascading style sheet (CSS). This is how the strict DTD is written:

      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"

      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

    Transitional DTD - XHTML

    • The transitional document type declaration tells Web browsers the Web pages contain markup language from both XHTML and HTML 4.01. This simply means that the obsolete underline tag that you can't use with strict DTD, you can use it with transitional DTD. The underline tag along with other deprecated elements and attributes will be recognized when the browser goes to load the page. According to Scripting Master, the transitional document type declaration is most often used to avoid compatibility issues that may occur within a browser. This is how the transitional DTD is written:

      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    Frameset DTD - XHTML

    • If you want your Web pages to contain frames, the frameset DTD is the best suited for that purpose. Other than the use of frames, the frameset DTD is the same as the transitional DTD. This is how the frameset DTD is written:

      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">

Source...
Subscribe to our newsletter
Sign up here to get the latest news, updates and special offers delivered directly to your inbox.
You can unsubscribe at any time

Leave A Reply

Your email address will not be published.