Using layers
In HTML, a layer is a container for other elements, such as paragraphs, images, tables, and so forth. Layers have two noteworthy properties:
- The position of a layer is explicitly specified.
- Layers can overlap each other and other elements.
You can think of a layer as a movable box that you put content into and that you can place anywhere on a page. Layers are a powerful, yet intuitive way to create complex page layouts, since you can put anything in a layer and simply drag the layer wherever you want.
An example of a layer overlapping other content
In this section
Creating and positioning a layer
Setting a layer’s initial visibility
Setting a background color or image on a layer
Setting borders, margins, and padding for a layer
Deciding which tag to use for layers