Drawing AP Divs

Dreamweaver wouldn’t be Dreamweaver if it didn’t give you several ways to perform a certain task, like creating an absolutely positioned div. You can do it as described above, or turn to two methods designed specifically to help you add AP divs to a page: You can drag to create an AP div freehand, or use a menu command to insert a full-blown, complete AP div. Your choices are:

  • Use the Draw AP div tool. You’ll find the Draw AP div tool in Insert panel’s Layout category (see Figure 9-5). Click the AP div button, and then drag the + cursor diagonally in the document window to create a box—the outline of the AP div.

    Tip

    For accurate drawing, you should hide Dreamweaver’s visual aids (like the AP div border and selection handles), which take up space and move AP divs slightly out of position in Design view. Ctrl+Shift+I(⌘-Shift-I) does the trick.

  • Use a menu command. To insert an AP div at the insertion point, choose Insert→Layout Objects→AP Div.

    If you don’t like the looks of the default AP div that Dreamweaver inserts, choose Edit→Preferences (Dreamweaver→Preferences), select the AP Elements category, and adjust the default properties. Add a background color, for example, or increase the AP div’s size. From then on, you can instantly create your favorite kind of AP div using the Insert→AP div command.

Dreamweaver’s AP div tools have one drawback: They create internal ID styles with generic names like apDiv1, apDiv2, and so on. So you don’t get to take advantage of the byte-saving ...

Get Dreamweaver CS5: The Missing Manual now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.