Click here!

Upload    Contact    Home


R E S O U R C E S

HTMLStuff:

 
 
Home
Artist
Designer
Webmaster
Programmer
What's New
* Resources
 

 

 

Basic DHTML for Netscape Navigator: The HTML

The Netscape Navigator (NN) Way
Netscape Navigator      Netscape Navigator uses the <layer> tag to group DHTML elements together into workable units. The <layer> tag is simply an HTML tag that is used in grouping similar content together. Keep in mind that the <layer> tag is not part of the W3C standards and the Netscape's way of implementing DHTML may change to suit the standards, (i.e. <div> tag). Then the <layer> tag's attributes are configured which then can be manipulated by JavaScript. Think of the <layer> tag as a transparent sheet of paper that you can put stuff on and always defaults to the upper-left corner.

The HTML
     The HTML needed to make DHTML work includes the use of the <layer> tag to group together DHTML elements such as text, images and other <layer> groups. So in a way, DHTML has a modular design as compared the to procedural design of regular HTML. By modular design I mean content is nicely contained in easily manageable units. Regular HTML is rather chaotic and not very structured making it harder to control. Below is an example of a how a DHTML page is structured into groups.

DHTML page Each block represents an opening and closing <layer> tag with various web page elements within them such as text, images and sub blocks.

     As you can see from the example above, DHTML has a very structured form. A modular way of thinking must be used in designing a DHTML page. Above, each DHTML block is really a <layer> and </layer> tag with attributes describing how to display the contents within it. Notice that the <layer> tag can only be configured with its attributes and not inline styles like IE. In other words, you can't use the style="" attribute in the <layer> tag. Below is an example of what the text block code looks like.

   <!-- ---------------TEXT BLOCK --------------- -->
   <layer id="story" 
   top="250" 
   left="200" 
   width="400" 
   z-index="1">
   <font face="tahoma" color="#333333">
      A pleasing land of drowsy head it was,<br>
      ...
   </font>   
   </layer>
     The <layer> attributes and their values will be explained later. For now just look at how the code is structured. The whole block of text is encased within the <layer> tags for use in the web page. In DHTML, this makes the text a controllable element of the web page. Now let's see what the navigation block's code looks like.
  1. <!-- -------------CONTROL BLOCK------------- -->
  2. <layer id="controls"
  3. top="100"
  4. left="700"
  5. width="50"
  6. height="300"
  7. Z-Index="1"
  8. visibility="show">
  9. <layer id="scrollup"
  10. top="0"
  11. left="0">
  12. <img src="up.gif" alt="Scroll Up">
  13. </layer>
  14. <layer id="scrolldown"
  15. top="200"
  16. left="0">
  17. <img src="down.gif" alt="Scroll Down">
  18. </layer>
  19. </layer>
     Notice how we encased an image within a <layer> tag within another <layer> tag. With DHTML you can create this kind of modular hierarchy to simplify page elements. How would you benefit from this kind of sub grouping? First, all the attributes of a <layer> tag are automatically inherited by what it encases. Thus, by adding more <layer> tags encased within the one, we can further define the attributes of an element. For example, above we encased an image within a specially positioned block which is further defined by the <layer> tag encasing it. So you see, traits are handed down from <layer> tag to <layer> tag in a kind of HTML tag inheritance.

     In the next section, we'll go over the attributes of the <layer> tag which gives them their personality.

Basic DHTML with Netscape Navigator
     Part 1: The HTML
     Part 2: The Attributes
     Part 3: The Script

Related Article: Introduction to DHTML
Related Article: Basic DHTML with Internet Explorer

Have a comment or question dealing with this tutorial? Write us!


Back to Tutorial Menu
Back to Designer Main Page
Back To HTML Stuff Main Page

 

  News   Contact   Advertise   CD ROM   Search   Upload   Help   Home

Copyright © 2000 Tucows.Com Inc.
TUCOWS.Com Inc. has no liability for any content or goods on the TUCOWS site or the Internet, except as set forth in the terms and conditionsand privacy stateme nt.