Inserting Content into Layers So you've set up the containers needed for your page layout, and everything's being controlled by an external style sheet. You've also begun creating additional pages for your site. Perfect. You're now ready to begin inserting content into your pages.You insert content on a layer just as you insert content directly on your page.Layers can hold any content that can normally appear on your web pagetext, graphics, tables, navigation bars, multimedia elements, and any other page element.To insert content on a layer, first click inside the layer. With the cursor inside the layer, begin inserting content just as you would insert content directly on your page. For nested layers, the process is exactly the same: just click inside the nested layer, and you're away. Knock yourself out.With your page's structure built and under firm control with CSS, you can begin inserting content into your layers. Inserting text, graphics, and other content into layers is just as easy as inserting it directly on your page.[View full size image] After you have your content on your layers, you can set additional CSS options for your layers to help control their contents. For example, you might want to mask part of a layer, add some padding to a layer, or put a margin around a layer to separate it more from other layers on your page.Here's how to insert and control content on a CSS layer:
1. | Click in the layer where you want your content to appear. Then insert the content just as you would if you were inserting it directly on the page. | 2. | In the CSS Style panel, double-click the style that you want to change. | 3. | In the CSS Rule Definition dialog box that appears, click a category on the left. For the example here, click the Positioning category. | 4. | Enter the values you want. For instance, to crop the content on your layer, enter values in the Clip fields.The values in the Clip fields determine the area within the layer's width and height is visible; any content outside that area is masked, or hidden. You set the layer's visible area by entering values in the L (left), T (top), R (right), and B (bottom) fields. Each of these values sets a corner point of a rectangle; each corner point's value is set relative to the top-left corner of the layer.For example, if your layer contains a photograph that's 300x200 and you want to shave off 10 pixels all the way around the image, you'd enter 10 px in the L and T fields, 290 px in the R field, and 190 px in the B field. These values create a box inside your layer that's 280x180. Any layer content that falls outside this box is hidden.Remember that clipping just masks layer content. You aren't permanently deleting anythingyou're just hiding it. | 5. | To add space between the edge of your layer and its contents, click the Box category; then set values in the Padding fields.Use the Clip fields in the Property Inspector to mask part of your layer's contents. Be sure to preview your page, and watch those target browserssome don't play nice with this setting.[View full size image] Noteworthy | If you use the Clip settings to mask part of your layer's contents, watch those target browsers. Even some popular browsers won't show it. | Keep Same for All selected if you want to use the same setting for all four sides of your layer; uncheck Same for All if you want to set individual values for each side. | 6. | To control the distance between the layer and other objects on the page, enter values for the Margin field.Again, keep Same for All selected to use the same value for each side, or deselect it to set individual values. |
Controlling Layer Stacking and Visibility Even though layers are great for controlling page layout, you can use them for many other things, too. For example, maybe you'd like to create a pop-up message that appears and disappears, or have some content that floats above the rest of your page. With layers, these sorts of things are possible by making use of layer stacking order and layer visibility.Stacking order is the order in which multiple objects (in this case layers) are stacked on top of one another on your page. Dreamweaver calls stacking order a layer's Z-Index, and it's good to understand if you want to be able to stack layers upon one another. A layer's visibility setting determines whether the layer is visible or hidden when your page opens in a web browser.Here's how to control layer stacking order and visibility:
1. | If it's not already open on your page, open the Layers panel by choosing Window > Layers. | 2. | To change the stacking order of your layers, in the Layers panel, drag a layer above or below other layers in the panel. |
This is the easiest way to change your layer's stacking order. Alternatively, you can enter a value in the Z-Index field on the Property Inspector. Layers with lower Z-Index values appear behind layers with higher values. However, choosing a Z-Index value isn't very intuitive.With Prevent Overlaps turned off in the Layers panel, you can move layers above and below each other, changing the layer's stacking order. The stacking order is determined by each layer's Z-Index, as can be seen in the Layers panel.[View full size image]
3. | If you want layers to overlap one another, uncheck the Prevent Overlaps option at the top of the Layers panel. With Prevent Overlaps turned off, you can now stack several layers above one another. | 4. | To set the visibility of a layer, choose an option from the Vis pull-down menu in the Property Inspector.The Vis menu determines the initial visibility of a layer when the page opens in the visitor's browser. You may want the contents of a layer hidden until a Dreamweaver behavior is triggered to show it. Or perhaps you want a pop-up message to appear when your page loads, which can then be closed by the visitor.Default: Allows the visitor's web browser to determine the layer's visibility. Most browsers use Visible by default (but if the layer is nested, most browsers use Inherit). Inherit: Sets the visibility of a nested layer to that of its parent. Visible: Displays the layer when the page is opened. Hidden: Hides the layer when the page is opened. Even though a layer may be hidden when your page opens in the visitor's browser, the contents of the layer are still there and still have to load; hidden content takes up just as much download time as visible content.You can also control a layer's visibility directly in the Layers panel. In the eye column on the left, click once to make a closed eye appear, indicating that the layer is hidden. Click again to make an open eye appear, indicating that the layer is visible. Click a third time to make the eye disappear, indicating that the layer's visibility is set to Default. |
|
 |