Adding Text
Text is entered into Dreamweaver by either typing directly in the Document window or cutting and pasting text from another source. Text can be selected for editing or cutting and pasting within the document using many of the same keyboard shortcuts available in most word processors, as well as using the mouse (see Table 3.1).
Table 3.1 Common Editing Keyboard Shortcuts
Keyboard Shortcut (Win) |
Keyboard Shortcut (Mac) |
Result |
Ctrl+X |
Command-X (or Shift-Delete) |
Cut |
Ctrl+C |
Command-C |
Copy |
Ctrl+V (or Shift+Insert) |
Command-V (or Shift-Insert) |
Paste |
Ctrl+Z |
Command-Z |
Undo |
Ctrl+Y |
Command-Y (or Command-Shift-Z) |
Redo |
Ctrl+A |
Command-A |
Select All |
Shift+Page Down |
Shift-Page Down |
Selects rest of page from insertion point |
Shift+Page Up |
Shift-Page Up |
Selects all text previous to insertion point |
Shift+End |
Shift-End |
Selects rest of the line |
Shift+Home |
Shift-Home |
Selects line previous to the insertion point |
Shift+Left Arrow |
Shift-Left Arrow |
Selects character to the left of the insertion point |
Shift+Right Arrow |
Shift-Right Arrow |
Selects character to the right of the insertion point |
Ctrl-Backspace |
Command-Backspace |
Deletes the previous word |
Ctrl+Delete |
Command-Delete |
Deletes the word to the right of theinsertion point |
After the text is entered into the document screen, you have many options for formatting it.
Paragraphs
A lot of the text in your documents is likely to be standard paragraphs. To create a paragraph break, simply press (Return) [Enter] and a blank line of white space is inserted below the paragraph.
NOTE
From a markup standpoint, Dreamweaver assumes your text is in paragraph format by default until you apply formatting to the contrary. All text within the <p>...</p> tag pair is formatted as one paragraph.
Line Breaks
White space is important for control of design and readability. In most HTML editors, including Dreamweaver, when you press the (Return) [Enter] key, a new <p> tag is inserted. Dreamweaver also automatically inserts a new HTML paragraph with a nonbreaking space entity between the opening and end tags. If you then type on this new line, the nonbreaking space is replaced with your content. If you leave the paragraph blank, however, the paragraph remains with a nonbreaking space. Because the tag is not empty, browsers correctly interpret this paragraph as a blank line.
Conversely, you might want to start a new line of text without that blank line inserted by the paragraph tags. To do this, use a line break. A line break inserts a carriage return in the text without closing the paragraph tag and, thus, without inserting extra space between the two lines (see Figure 3.1).
Figure 3.1 The first paragraph of this text is formatted with a standard <p> tag pair. The second paragraph contains line breaks to place the food descriptions on separate lines within the same paragraph.
To add a line break, follow these steps:
Position your cursor where you want to force a line break.
Select Insert, Special Characters, Line Break from the menu, or press (Shift-Return) [Shift+Enter].
The text is forced to a new line without additional white space between lines. Line breaks can also be used to force more white space within a paragraph by adding multiple breaks consecutively.
→ Find out why you'll get a validation error if text isn't properly formatted in strict HTML or XHTML documents in "Validation Errors Related to Text" in the "Troubleshooting" section at the end of this chapter.