'z-index' Example : z index : CSS Attributes and Javascript Style Properties HTML CSS TUTORIALS


HTML CSS TUTORIALS » CSS Attributes and Javascript Style Properties » z index »

 

'z-index' Example



    
<div id="myDiv" 
     style="position:absolute; 
            left:168px; 
            top:251px; 
            width:192px; 
            height:66px; 
            z-index:1; 
            background-color:red;">
an z-index of 1.
</div>
<div style="position:absolute; 
            left:168px; 
            top:251px; 
            z-index:12; 
            height:50; 
            background-color:blue;">
a z-index of 12.
</div>
<button onclick="myDiv.style.zIndex = 20;">
Bring red to front
</button>

    
      
      



HTML code for linking to this page:

Follow Navioo On Twitter

HTML CSS TUTORIALS

 Navioo CSS Attributes and Javascript Style Properties
» z index