• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL

Chapter 16. Netscape Layers > Importing External Content with Netscape Layers

Importing External Content with Netscape Layers

One of the most useful capabilities of Netscape layers is that they allow you to import content from other HTML files—that is, you can draw the content of a layer from another HTML file.

To add attributes to a layer:



Set up the external file that you will be importing into index.html. This file can contain any standard HTML that you would find between the <body> tags of an HTML document, but it should not include <html>, <head>, or <body> tags (Code 16.2).



Set up your HTML file into which you want to import the external file from step 1, and save it as something like index.html. Steps 3 and 4 apply to this file (Code 16.3).


<layerid="layer1" src="layer1.html"
→ bgcolor="#CCCCCC">

Open your layer tag. In the layer tag from step 1, type the attributes you want to use to define this layer. In this example, an external source document is being loaded into the layer. The layer is identified with a name (layer1) as well as a background color.

Code 16.3. index.html contains four Netscape layers. The first layer pulls its source from a file called layer1.html.



Close your layer container. If you define an external source by using the SRC attribute for a layer, you cannot include any other content within the layer-container tags.

The result is that layer 1 pulls in an external file with the Mad Hatter and, despite being defined before layer 2, layer 1 appears on top of layer 2 because of the above attribute set in layer 2 (Figure 16.2). Layer 4 has been nested in layer 3, but because it has been positioned with pageX and pageY, it is still positioned absolutely in relation to the document, not in relation to layer 3.

Code 16.2. Four layers have been set up. Layer 1 is importing a picture of the Mad Hatter from an external file.

Figure 16.2. layer1.html includes the external content to be used by index.html. Notice that there are no <html>, <head>, or <body> tags.



Not a subscriber?

Start A Free Trial

  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint