Collapsing code. Adobe Dreamweaver CS4
تبلیغات
تبلیغات
USING DREAMWEAVER CS4
Working with page code
313
3 Specify printing options, and then click OK (Windows) or Print (Macintosh).
Collapsing code
About collapsing code
You can collapse and expand code fragments so that you can view different sections of your document without having to use the scroll bar. For example, to see all of the CSS rules in the head tag that apply to a div tag farther down the page, you can collapse everything between the head tag and the div tag so that you can see both sections of code at once. Although you can select code fragments by making selections in Design view or Code view, you can collapse code only in Code view.
Note: Files created from Dreamweaver templates display all code as fully expanded, even if the template file (.dwt) contains collapsed code fragments.
More Help topics
“ Paste and move collapsed code fragments ” on page 314
“ Insert code with the Coding toolbar ” on page 301
Collapse and expand code fragments
When you select code, a set of collapse buttons is displayed next to the selection (Minus symbols in Windows; vertical triangles on the Macintosh). Click the buttons to collapse and expand the selection. When the code is collapsed, the collapse buttons change to an expand button (a Plus button in Windows; a horizontal triangle on the Macintosh).
Sometimes, the exact fragment of code that you selected is not collapsed. Dreamweaver uses “smart collapse” to collapse the most common and visually pleasing selection. For example, if you selected an indented tag and then selected the indented spaces before the tag as well, Dreamweaver would not collapse the indented spaces, because most users would expect their indentations to be preserved. To disable smart collapse and force Dreamweaver to collapse exactly what you selected, hold down the Control key before collapsing your code.
Also, a warning icon on collapsed code fragments is displayed if a fragment contains errors or code that is unsupported by certain browsers.
You can also collapse the code by Alt-clicking (Windows) or Option-clicking (Macintosh) one of the collapse buttons, or by clicking the Collapse Selection button in the Coding toolbar.
1 Select some code.
2 Select Edit > Code Collapse, and select any of options.
More Help topics
“ Edit code with the Coding context menu ” on page 305
“ Insert code with the Coding toolbar ” on page 301
Select a collapsed code fragment
❖ In Code view, click the collapsed code fragment.
Updated 24 September 2009
USING DREAMWEAVER CS4
Working with page code
314
Note: When you make a selection in Design view that is part of a collapsed code fragment, the fragment is automatically expanded in Code view. When you make a selection in Design view that is a complete code fragment, the fragment remains collapsed in Code view.
View the code in a collapsed code fragment without expanding it
❖ Hold the mouse pointer over the collapsed code fragment.
Use keyboard shortcuts to collapse and expand code
❖ You can also use the following keyboard shortcuts:
Command
Collapse Selection
Collapse Outside Selection
Expand Selection
Collapse Full Tag
Collapse Outside Full Tag
Expand All
Windows
Control+Shift+C
Control+Alt+C
Control+Shift+E
Control+Shift+J
Control+Alt+J
Control+Alt+E
Macintosh
Command+Shift+C
Command+Alt+C
Command+Shift+E
Command+Shift+J
Command+Alt+J
Command+Alt+E
Paste and move collapsed code fragments
You can copy and paste collapsed code fragments, or move collapsed code fragments by dragging.
More Help topics
“ Insert code with the Coding toolbar ” on page 301
Copy and paste a collapsed code fragment
1 Select the collapsed code fragment.
2 Select Edit > Copy.
3 Place the insertion point where you want to paste the code.
4 Select Edit > Paste.
Note: You can paste into other applications, but the collapsed state of the code fragment is not preserved.
Drag a collapsed code fragment
1 Select the collapsed code fragment.
2 Drag the selection to the new location.
To drag a copy of the selection, Control-drag (Windows) or Alt-drag (Macintosh).
Note: You cannot drag to other documents.
Updated 24 September 2009
دانلود
تبلیغات