![]() |
|
Every page must have a Document Type Definition (DTD). These also existed in HTML but it didn't matter whether you included one on the page or not. A DTD defines the legal structure, tags and attributes that a page can use. In other words, it defines the legal syntax. In XHTML there are three XHTML DTDs: Strict, Transitional, or Frameset. The XHTML DTDs are more or less the same as the existing HTML ones. The strict doctype declarationUse this definition if you intend to write entirely correct XHTML code and if you use Cascading Style Sheets (CSS) to format your pages. <!doctype html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/strict.dtd"> Strict XHTML dispenses with a whole lot of presentational tags and attributes. In other words, you can’t use the <font> tag at all, nor attributes like width and height in your tables. You can’t use the border attribute on images, and you’ll have to use the alt attribute on all images. It doesn’t allow you to use any deprecated tags. The transitional doctype declarationUse this definition if you need to use presentational markup in your document. Most of us will be using the transitional DTD for quite some time, because we don't want to limit our audience to users with browsers that support CSS. <!doctype html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/transitional.dtd"> The frameset declarationUse this definition if your pages have frames. <!doctype html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/frameset.dtd"> In Allaire’s Homesite, you can add these three declarations to your editor by going to Settings on the Options menu and then selecting Code Templates from within the Editor branch. Add each XHTML declaration. You can then access these declarations by using Ctrl-J from within a file and then selecting the declaration you want from the pop-up list. Alternately, you can automatically insert one of the declarations into your new files by changing your default HTML template or by creating a new template. If you plan to edit the default HTML template, you can find it in the Wizards/HTML directory of your installation folder. Open the file and replace the existing HTML declaration with one of the XHTML declarations. After saving the file, your new files will automatically use the XHTML declaration. |
More information What does and XHTML page look like? XHTML DTDs |