Of course, these are not real laws, but just some helpful advice to avoid getting into the pitfalls you may get into when using layers. There were originally nine laws, but we have simplified one and have the following eight:
1. If you want to nest layers, never use multiple parent layers. They should share a common single parent layer. If you must use nested levels that are not fully qualified in the style sheet, you should always check in Netscape 4x.
2. Always place text in a table within a layer - the table should be absolutely sized (in pixels, not percentages) and no larger than the layer, although nested tables within the main table can be set to relative percentages size. Doing this prevents NC4xx from resizing text to unexpected positions when the window size changes.
3. Never place layers in tables. Netscape 4x will not understand layers in tables correctly.
4. Always use the Netscape Resize Fix plugin on any page that has layers or CSS styles.
5. Do not expect an absolutely positioned layer to remain aligned with a centered table or page content when the browser window size or screen resolution changes. There are plug-ins available to dynamically achieve this effect.
6. Don't try to place scrollbars in layers (using the overflow attribute) - use a DHTML scroller or Project Seven IFRAME technology instead. For Netscape 4.x users, you can set a specific popup page in the IFRAME.
7. Never give a layer the same name as an image - each layer should have its own name that is unique and distinguishable from other elements on the page (in fact, you should never have two elements with the same name appear in on the same page).
8. Do not apply events/behaviors directly to layers. They will not work across browsers. Apply them to the content (links or images) in the layer rather than the layer itself.