Setting Up a Document > Creating, opening, and saving HTML documents

 

Creating, opening, and saving HTML documents

Dreamweaver offers various ways to create a document. You can create new, blank HTML documents; you can open an existing HTML document, even if it wasn't created in Dreamweaver; or you can create a new document based on a template.

You can also open non-HTML text files, such as JavaScript files, plain text e-mail files, or text files saved by word processors or text editors. You can't use all of Dreamweaver's document-editing tools on a plain text document, but you can use basic text-editing features. Reasons to open text documents might include editing and debugging JavaScript code, looking at the contents of a Dreamweaver configuration file, or opening a piece of e-mail that contains a snippet of HTML, to copy that code and paste it into another document.

To create a blank HTML document in a new Document window, do one of the following:

In Windows, choose File > New from an existing Document window, or choose File > New Window from the Site window.
On the Macintosh, choose File > New.

If you open the Code view (in the Document window) or the Code inspector, you can see that the new document isn't completely blank—it contains html, head, and body tags to get you started. As you type in the Document window's Design view or insert objects such as tables and images, you can leave a code editor open and watch as the HTML source code is created. For more information on the code editors, see Using the Code view (or Code inspector).

To open an existing HTML file, do one of the following:

Choose File > Open.
If the file was created using Microsoft Word, choose File > Import > Import Word HTML.
If you choose Import Word HTML, Dreamweaver opens the file and then lets you specify options for removing extraneous HTML code generated by Word. (Microsoft Word 97 and later versions provide a Save as HTML feature, which adds unnecessary HTML code as it converts a document to HTML.) For more information, see Cleaning up Microsoft Word HTML.
Note: You can't directly import a Microsoft Word (.doc) file into Dreamweaver. If you want to import the contents of a Word file, launch Word and save the file as HTML before importing the resulting HTML file into Dreamweaver.

To create a new document based on a template:

1 Choose File > New from Template.
A dialog box appears, listing the templates available for the current site. (You must create templates before you can create documents based on them; see Creating templates.)
When you create a document based on a template, some parts of the document are locked so that they can't be edited. (The template file determines which regions are editable and which are not.) This ensures consistency when you use a template for multiple documents in a site.
2 Select a template and click Select.
A new document is created based on the template. Each editable part of the new document is surrounded by a blue border by default. The entire document is surrounded by a yellow border (by default), as a reminder that it's based on a template and that some parts of it are therefore locked. (To customize the colors of the borders, see Template preferences.) To modify an editable part of the template, select the placeholder content in the editable region and type over it. In some cases, there is no placeholder content in the editable region; in those cases, click inside the editable region.

To learn more about designing and working with templates, see Templates and libraries overview.

To save a document:

1 Choose File > Save.
2 Provide a name for the file and navigate to where you want the file to be saved.
Note: Dreamweaver automatically adds .htm (Windows) or .html (Macintosh) to the file name when the dialog box first appears. (You can control what file extension is added by using an option in General preferences.) To save a file as plain text in Windows, give it a .txt file name extension. To save a file as plain text on the Macintosh, simply remove the .html from the name of the Macintosh file. (To make Dreamweaver see the file as an HTML file again, save it again with the .html (or .htm) extension.) After you save a file as text, Dreamweaver does not interpret any HTML code in the file.
When you save your documents, avoid using spaces and special characters in file and folder names whenever possible. In particular, do not use special characters (such as é, ç, or ¥) or punctuation (such as colons, slashes, or periods) in the names of files you intend to put on a remote server; many servers change these characters during upload, which will cause any links to the files to break. Also, do not begin a file name with a numeral.
3 Click the Save button to save the file.