Set document type information

Browsers read the DocType declaration on pages to determine which version of HTML the page uses. You can set a default DocType so that Microsoft Expression Web automatically inserts a DocType declaration on new pages. You can also choose not to automatically insert a DocType declaration on new pages. Here's an example of a DocType declaration:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

The DocType declaration on a web page also determines the schema Expression Web uses to drive incompatibility notifications and IntelliSense for HTML and script. Expression Web uses the secondary schema if a page has an unrecognized or missing DocType. If there is an incompatibility or error in your HTML, Expression Web adds an icon to the status bar. The Code Error Detected icon Cc295208.fd9d51e2-61d0-43db-a4d3-337b15a9cd08(en-us,Expression.40).png indicates an error in the code on your page. The HTML Incompatibility Detected icon Cc295208.5fb96433-0028-4391-9551-099fc9f00989(en-us,Expression.40).png indicates an incompatibility in your code with the HTML schema you selected.

For information about setting CSS schema options, see Using IntelliSense with cascading style sheets.

For information about setting other IntelliSense options, see Set IntelliSense options.

Note

Pages which do not have a DocType declaration appear with Quirks in the status bar at the bottom of the window.

To set the default DocType declaration that Expression Web inserts when you create new pages

  1. On the Tools menu, click Page Editor Options.

  2. In the Page Editor Options dialog box, on the Authoring tab, select the Doctype and Secondary Schema you want to use for all new files.

    Note

    To prevent Expression Web from inserting a DocType declaration, in the Doctype box, select None.

To change the DocType declaration in an existing page

  1. In the Code view of your page, do one of the following:

    • If there is already a DocType declaration in the page, select the entire DocType declaration.

    • If there is not a DocType declaration in the page, put your cursor at the very top of the page before all other code in your page.

  2. Do one of the following:

    • Press CTRL+ENTER.

    • On the Edit menu, point to IntelliSense, and then click List Code Snippets.

    • On the Code View toolbar, click List Code Snippets Cc295208.46b19a6d-a612-4533-baa4-b3973ef10883(en-us,Expression.40).png.

  3. In the list of code snippets, do one of the following:

    • Type the keyword for the code snippet, and then press ENTER or TAB to insert it.

    • Select the code snippet you want to insert, and then press ENTER or TAB to insert it.

    • Double-click the code snippet you want to insert.

See also

Tasks

Set the default HTML file extension
Add or remove byte order marks
Compatibility reports

Reference

Status bar

Send feedback about this topic to Microsoft. © 2011 Microsoft Corporation. All rights reserved.