What are some common problems, pitfalls, or issues with Layers or absolutely positioned DIVs that I should be aware of? What about tables inside layers or height property issues, or Mac problems, or nesting, or overflow?
Here are some some simple guidelines to help you use work with Dreamweaver Layers (absolutely positioned DIVs) properly:
Never insert a layer unless you know precisely where its code is going to go. Dreamweaver will make sure the code is properly placed only if you use the "Draw Layer" Object. Using the Insert - Layer command from the Insert Menu can be problematic. Here's an overview of both methods:
To draw a layer, click the Draw Layer icon on the Object Panel (Dreamweaver 4) or the Insert Bar (Dreamweaver MX & MX2004) and use your mouse to drag out a rectangular shape approximating the size layer you need. Dreamweaver will write the layer's source code in an appropriate area of your document's <body> region. See our infoBase article#134 for a detailed discussion.
Choose Insert - Layer (or Insert-Layout Objects-Layer in MX2004). A layer will be inserted and its code placed wherever your cursor happens to be. If your cursor is inside a table, that's where your code will go and it will stay there even if you drag or otherwise move the layer about your screen in Dreamweaver's editor window. Moreover, when you use this method, Dreamweaver will not write positioning styles. Your layer will have neither top nor left properties defined. To complete Dreamweaver's job, you'll need to manually move the layer at least one pixel up and one pixel down. We recommend using this Layer creation method only for advanced users or if you are following explicit instructions in a reliable tutorial.
You should never place a layer inside a table, but you can certainly place a table inside a layer. However, it is not required. If your design will benefit from a table inside your layer (for a 2-column setup, for instance), make sure that your table is set to a fixed width equal to the width of your layer. The most reliable way to insert text into a layer is simply to type it in.
If you are an advanced designer, you may be defining your Layers in external style sheets using ID selectors. This is very cool, very good, and very efficient. However, MX has a little quirk. Here's how it goes:
If you accidentally move or resize a layer that is defined in an external style sheet, Dreamweaver MX will actually rewrite the style sheet rule. This is very nice except for the fact that you get no warning. Since your style sheet is probably not open, Dreamweaver will make the change under the hood and your style sheet will have been changed and saved. Solutions: