Explain about layers in HTML.


  Explain about layers in HTML.
CSS gives you opportunity to create layers of various divisions. The CSS layers refer to applying the z-index property to elements that overlap with each other.
The z-index property is used along with the position property to create an effect of layers. You can specify which element should come on top and which element should come at bottom.
A z-index property can help you to create more complex webpage layouts. Following is the Example which shows how to create layers in CSS.
Z–index: n:- The browse maintain the stack of layers of contents.
The background image is placed first with the text and images on top of it.For each that you use, you can determine where in that stack it will appear by setting the ‘Z-index’ parameter.

The lowest layer appearing on the top of the background has a z – index of ‘1’.Many layers can have the same z-index value if you want to place them in the same level.

Position: absolute/relative: Divisions has to be placed on the screen at specific location but the placement of that layer may be either absolute (or) relative.

Left:n, top:n:- A location of that division in pixels.

Width:n, height:n:- The size of the division in pixels.
  
  
  
     
         width:300px;
         height:100px;
         position:relative;
         top:10px;
         left:80px;
         z-index:2">
     
      
         width:300px;
         height:100px;
         position:relative;
         top:-60px;
         left:35px;
         z-index:1;">
     
     
         width:300px;
         height:100px;
         position:relative;
         top:-220px;
         left:120px;
         z-index:3;">
     
  

Related

Web Technology 8727971664948790153

Post a Comment

emo-but-icon

Follow Us

item