Home

How to Add a DOCTYPE in Dreamweaver

|
|  Updated:  
2016-03-27 11:15:51
HTML & CSS Essentials For Dummies
Explore Book
Buy On Amazon

If you’re a Dreamweaver user, you almost don’t have to think about the document type definition (DTD) when creating a web page because the program automatically inserts the selected DOCTYPE and DTD into the code each time you create a new document through the New Document dialog box.

Of course, you have other ways to create a new file in Dreamweaver, and in those cases, the program’s default DTD, as specified in the program’s preferences, will be automatically inserted.

No matter which DTD you select, Dreamweaver automatically writes the appropriate DTD-specific code. For example, if you choose to build pages using the XHTML 1.0 transitional DTD, Dreamweaver’s code editor automatically writes XHTML-compliant code. Likewise, when you choose HTML5, Dreamweaver writes HTML5-compliant code.

To select the appropriate DTD for your new documents in Dreamweaver, follow these steps:

Launch Dreamweaver and choose File→New to open the New Document dialog box and select the Blank Page option from the top-left column.

Launch Dreamweaver and choose File→New to open the New Document dialog box and select the Blank Page option from the top-left column.

Select the HTML option from the Page Type Category, and choose from the Layout column.

Dreamweaver opens a new blank HTML file.

In the DocType area in the lower-right corner of the dialog box, use the menu to select the desired document type (DTD).

In the DocType area in the lower-right corner of the dialog box, use the menu to select the desired document type (DTD).

Over the years, the default in the DocType area has changed from version to version in Dreamweaver. For a long time it was set to HTML 4.01 Transitional before Adobe switched it to XHTML 1.0 Transitional. At the time of this writing, the DocType area may be set to HTML5.

The options in this list are None, HTML 4.01 Transitional, HTML 4.01 Strict, XHTML 1.0 Transitional, XHTML 1.0 Strict, HTML5, XHTML 1.1, and XHTML Mobile.

To modify the default DTD in your copy of Dreamweaver, open the Preferences dialog box by choosing Edit→Preferences (Windows) or Dreamweaver→Preferences (Mac), click the New Document category, and choose the desired Default Document Type from the DTD menu.

Click the Create button to open the new, blank HTML or XHTML page in the Dreamweaver workspace.

If you check the code in Code view, you can see the selected DTD at the top of the page, above the opening HTML tag.

Older versions of Dreamweaver, including MX and earlier, either didn’t provide an option to select the DTD or coded in only part of it automatically. If you’re still using an old version of Dreamweaver or another code editor that doesn’t include the DTD, be sure to hand-code the appropriate DTD into your pages or upgrade your software so that your program does it for you automatically.

About This Article

This article is from the book: 

About the book author:

Sue Jenkins is a working designer as well as a design trainer and author. Her design firm, Luckychair, provides design services for web, logo, and print. Jenkins has also created a series of courses on popular Adobe design tools including Photoshop and Illustrator.