• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

The Z-Index Property

Positioning elements frequently causes them to overlap and, in fact, the possibility of having elements overlap is an important reason for using positioning in the first place. The normal rule is that elements that come later in the source document are on top of earlier elements. But, as we saw in the example with the star (refer to Figure 9.2), that is not always what we want. That example therefore used the z-index property to explicitly put the image behind its containing block. Figure 9.7 shows an example.

Figure 9.7. The effect of z-index: a3 has the highest z-index and is on top; a4 has the lowest z-index and is behind the others.



PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint