What You Have LearnedIn this lesson, you have:
|
Lesson 9. Creating
|
What You Will LearnIn this lesson, you will:
|
Approximate TimeThis lesson should take about two hours to complete. |
Lesson FilesMedia Files: Lesson_09_Layers/Images/…(all files) Starting Files:
Lesson_09_Layers/
Completed Project: Lesson_09_Layers/Completed/layers.html Lesson_09_Layers/Completed/layers_table.html Lesson_09_Layers/Completed/transparent.gif |
Creating
|
|
1. |
Tip You should be using Design view for this lesson. Standard view is the default, and the Standard button on the Insert bar will be highlighted to
|
|
2. |
Click the Draw Layer button in the Layout category of the Insert bar. Move the pointer into the Document window; then click and drag to create a new layer on the right side of the page.
|
|
3. |
Choose Dreamweaver > Preferences (Macintosh) or Edit > Preferences (Windows). Select the Invisible Elements category and check the Anchor Points For Layers box. Click OK.
Note
You can use the layer marker to select the layer, but if your layer is positioned at the top left of the Document window, the marker could appear to shift the position of the layer. This shift happens only in the Document window; when the page is
Note Dreamweaver recognizes several additional tags that can be used to create layers ( <span> , <layer> , and <ilayer> ), but it does not provide the option to use these tags to create layers. The <span> tag, which is an inline element, uses relative positioning to determine the placement of the layer depending upon the position of other elements around it. The <layer> and <ilayer> tags were supported only in Netscape Navigator 4. Netscape no longer supports these tags, and Internet Explorer has never supported them. The Design view does not render or display these types of layers, although it does insert a layer marker for the layer. |
|
4. |
Position the pointer over the border of the layer. Click to select the layer when the pointer turns into a hand (Macintosh) or a four-headed arrow (Windows).
|
|
5. |
Place the insertion point inside the layer. Insert a table into the layer with the following attributes: 1 row, 1 column, 300 pixels wide, border of 0, cell padding of 5,
Tip The Layout category of the Insert panel contains an insert Table button. The layer expands if necessary to accommodate the |
|
6. |
Place the insertion point in the document outside the layer. Click the Draw Layer button and draw a small second layer on the left side of the page. Insert the studio-om.jpg image from the Lesson_09_Layers/Images folder, into the layer. Use
OM
for the alternative text for the image.
Tip To draw multiple layers continuously without clicking Draw Layer more than once, hold down Cmd (Macintosh) or Ctrl (Windows) as you draw the first layer. You can continue to draw new layers until you release the modifier key. If the insertion point is within a layer when you insert the layer, the new layer is nested inside the other layer.
Tip Be aware that nested layers can cause problems in older browsers. At this point, your document should look similar to the example shown here.
Note Layers that are not selected and not activated are displayed with a faint, thin gray line marking their borders. You can turn this on or off by choosing View > Visual Aids > Layer Borders. A checkmark next to the command in the menu indicates that the option is on. |
|
7. |
Place the insertion point in the document outside the first and second layers and then choose Insert > Layout Objects > Layer. Insert the teaching.jpg image from the Lesson_09_Layers/Images folder into the layer and type
teaching
for the alternative text for the image.
Note Dreamweaver's default is 200 pixels for the width and 115 pixels for the height, but you can change these options in the Layers category of the Preferences dialog box. To open the Preferences dialog box, choose Dreamweaver > Preferences (Macintosh) or Edit > Preferences (Windows) and choose the Layers category. You can also use the Layers preferences to set default visibility, background, nesting, and compatibility options, all of which will be covered later in this lesson. Depending on the location of the insertion point, markers might not be visible for the layer you just placed, although the layer code has been inserted. The layer markers might be hidden behind the new layers. When adding layers by drawing them onto the pages, the layer code will be placed at the top of the page, with no paragraphs or other code between them. Using other |
|
8. |
Click in the Document window outside of the existing layers to deselect the layer you inserted in the previous step. Drag the Draw Layer icon from the Insert bar into the Document window and drop it outside the existing layers. Click inside the new layer to place the insertion point inside of it and insert the class.jpg image from the Lesson_09_Layers/Images folder into the layer; type
class
for the alternative text for the image.
Tip Don't drop the Draw Layer icon into another layer; dropping it would cause the layers to be nested.
|
|
9. |
Save the layers.html document.
|
Leave this file open for the next exercise.
With each method of creating a layer that has been used in this exercise, the <div> tag was placed in the body of the document, whereas the CSS properties that define those layers were placed in an internal style sheet in the head of the document. CSS was covered in Lesson 4. Another way to create layers would be to specify the CSS properties that define the placement and positioning of the layers in an external style sheeteither by exporting the internal styles or by initially creating the styles in the external style sheet.