Editing HTML in Dreamweaver > Setting code formatting preferences > Code Format preferences |
![]() ![]() ![]() |
Use the following Code Format preferences to control code formatting such as indentation, line length, and the case of tag and attribute names. (For information on additional code formatting controls, see Changing default HTML formatting.)
Note that all the preferences except Override Case Of affect only new documents and new additions to existing documents. That is, when you open a previously created HTML document, these formatting options are not applied to it; to reformat existing HTML documents, use the Apply Source Formatting command. (See Formatting the HTML source code in existing documents.)
Indent turns on indentation of all tags marked indent
in the SourceFormat.txt file. See Changing default HTML formatting.
Use specifies whether to indent using spaces or tabs.
Table Rows and Columns automatically indents tr
and td
tags to make table code easier to read. The Indent option must be selected for this option to work.
Frames and Framesets automatically indents frame
and nested frameset
tags to make frameset files easier to read. The Indent option must be selected for this option to work.
Indent Size determines the size of indents. The size is measured in spaces if Use is set to spaces, or in tabs if Use is set to tabs.
Tab Size determines the size of tabs (measured in character spaces).
Automatic Wrapping adds "hard" returns once a line reaches the specified column width. (Note that Dreamweaver inserts hard returns only in places where they don't change the appearance of the document in browsers, so some lines may remain longer than the Automatic Wrapping option specifies.) By contrast, the Wrap option in the Code view (or Code inspector) adds a "soft" return for lines that extend beyond the width of the window.
Line Breaks specifies the type of remote server (Windows, Macintosh, or UNIX) that hosts your remote site. Choosing the correct type of line break characters ensures that your HTML source code appears correctly when viewed on the remote server. (Note that for FTP, this setting applies only to binary transfer mode; Dreamweaver's ASCII transfer mode ignores this setting. If you download files using ASCII mode, Dreamweaver sets line breaks based on the operating system of your computer; if you upload files using ASCII mode, the line breaks are all set to CR LF.) This setting is also useful when you are working with an external text editor that recognizes only certain kinds of line breaks. For example, use CR LF (Windows) if Notepad is your external editor, and CR (Macintosh) if SimpleText is your external editor.
Case for Tags and Case for Attributes control the capitalization of tag and attribute names. These options are applied to tags and attributes that you insert or edit in the Document window, but they are not applied to the tags and attributes that you enter directly in the Code view (or Code inspector), or to the tags and attributes in a document when you open it (unless you also select one or both of the Override Case Of options).
Override Case Of: Tags and Attributes specify whether to enforce your specified case options at all times, including when you open an existing HTML document. When you select one of these options, all tags or attributes in open documents are immediately converted to the specified case, as are all tags or attributes in each document you open from then on (until you deselect this option again). Tags or attributes you type in the Code view (or Code inspector) and the Quick Tag Editor are also converted to the specified case, as are tags or attributes you insert using the Objects panel. For example, if you want tag names always to be converted to lowercase, specify lowercase in Case for Tags, and then select the Override Case Of: Tags option. Then when you open a document that contains uppercase tag names, Dreamweaver converts them all to lowercase.
Centering specifies whether elements should be centered using div align="center"
or center
. Both are part of the HTML 4.0 Transitional specification, but center
is supported by a wider range of browsers.
![]() ![]() ![]() |