Layers
Layers are another alternative to frames or tables for controlling a web page’s layout. Unlike other HTML elements, layers provide both compositing (i.e., two elements can occupy the same area) and absolute positioning (i.e., you can specify the coordinates of a layer relative to the upper-left corner of the browser window or relative to another layer). Layers are empty containers into which you can insert other elements, such as text and graphics.
Tip
Unlike other HTML elements, the visual position of a layer on the page is unrelated to the location of the layer tag within your HTML code. Instead, layer positioning is controlled by the coordinate attributes specified within the tag itself.
Layers require CSS and therefore require at least IE4. Whereas NN4 supports layers, it doesn’t support advanced features such as nested layers. See the discussion under Section P.4.3 in the preface for more information. Layers can also be used for special effects and animation as described in Chapter 14 and Chapter 17. Consider using Macromedia Flash or Shockwave for more demanding animations or interactivity.
Although layers were originally designed for page layout, tables still offer more reliable alignment in most browsers. If you like, you can design your page using the layer tools and then choose Modify → Convert → Layers to Table to transform your layers to tables (however, you can’t convert layers to tables if any of the layers overlap). You can also convert layers to a table using ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access