Click Edit > Preferences (on Windows) or Dreamweaver > Preferences (on Mac).
Learn how to collapse and expand code in Dreamweaver to view sections of your document without scrolling.
You can collapse (also called as fold) and expand code fragments to view different sections of your document without scrolling.
For example, to see all the CSS rules in the head tag that apply to a div tag farther down the page, fold the code between the head tag and the div tag to see both sections of code at once.
You can select a portion of code to collapse it. You can also collapse code in HTML, PHP, XML, and SVG files based on tag blocks. In CSS, Less, Sass, SCSS, and JS files, you can collapse code based on curly brackets.
If the selection changes, the code is automatically collapsed back again.
Files created from Dreamweaver templates display all code as fully expanded, even if the template file (.dwt) contains collapsed code fragments.
The default code folding size is two lines. With this default setting, all code fragments that have at least two lines of code are collapsible. Code fragments that are lesser than two lines can be collapsed by selecting the code.
To change the minimum number of lines for code folding:
Click Edit > Preferences (on Windows) or Dreamweaver > Preferences (on Mac).
Click Code Format in the Category list and specify the minimum code folding size.
By default, all the code in Code view is in expanded mode.
However, you can collapse code by selecting several lines, and collapsing them. You can also collapse code based on the syntax - tag blocks or curly brackets.
The collapsed or expanded states of code blocks are retained across Dreamweaver sessions.
To collapse code based on tag blocks or curly brackets:
In Code view, a small triangle appears next to the line numbers corresponding to code blocks that are greater than the number of code folding lines specified in the code folding size preferences.
Click the triangle to collapse or expand the code.
To expand all the collapsed code in the document, you can use the keyboard shortcut Control+Alt+E (Win); Command+Alt+E (Mac).
To collapse code based on selection:
In Code view, select the code fragment that you want to collapse.
Click the triangle icon that appears to collapse and expand the selection.
Command |
Windows |
Macintosh |
Collapse Selection |
Control+Shift+C |
Command+Shift+C |
Collapse Outside Selection |
Control+Alt+C |
Command+Alt+C |
Expand Selection |
Control+Shift+E |
Command+Shift+E |
Collapse Full Tag |
Control+Shift+J |
Command+Shift+J |
Collapse Outside Full Tag |
Control+Alt+J |
Command+Alt+J |
Expand All |
Control+Alt+E |
Command+Alt+E |
Click the collapsed code fragment to select it.
Place the cursor at the point where you want to paste the code.
Logige oma kontole sisse