|
Techniques for embedding a document inside another Part 2- The <layer> tag
NS 4+
The complimentary
<ilayer> tag
Assuming you've tried using the <layer> tag and it's src property,
you should have noticed that the external document floats above the rest of the page,
overlapping any content beneath it, as anything inside a layer should do. That's a
problem, unless you don't mind your surfers not being able to see half of the page! Here's
where the <ilayer> tag comes in. A sibling of the <layer> tag, the
<ilayer> tag is used when you wish a layer to be positioned inline with the rest of
the content. By wrapping the <layer> tag inside <ilayer>, the content inside
of it is brought back to earth, inline with everything else. In most circumstances, you'll
want to embed a document inside another in NS 4 using both the <layer> tag and the
<ilayer> tag. "Ok, just show me an actual example already!" you yell. Sure
thing. Take a look at the below code:
<ilayer><layer src="external.htm"></layer></ilayer>
What you see above is "external.htm", embedded inside this
document!
Conclusion
The technique I've shown you in this tutorial for embedding a document is
far from perfect. Depending on which version of NS 4 you have, you may notice different
bugs occurring when using this technique (such as the page appearing "messed" up
etc). However, this is currently the only way in NS 4 to add a document to another, so
being picky isn't an option here. Next week, in the final part of this three-part
tutorial, I'll show you a browser-independent, server side technique to embedding a
document-by using SSI. It is the perfect way to embed a document, assuming your server
supports this feature...stay tuned! |