2017-04-26 41 views

回答

1

.parent { 
 
    width: 300px; 
 
    height: 300px; 
 
    background-color: #F4F4F4; 
 
} 
 

 
.child { 
 
    width: 200px; 
 
    height: 200px; 
 
    background-color: red; 
 
    border: 4px solid #000; 
 
    opacity: .9; 
 
    
 
    position: relative; 
 
    z-index: 2; 
 
} 
 

 
.other { 
 
    width: 150px; 
 
    height: 150px; 
 
    background-color: green; 
 
    border: 4px solid #000; 
 
    opacity: .9; 
 
    
 
    position: absolute; 
 
    top: 150px; 
 
    z-index: 1; 
 
}
<div class="parent"> 
 
    <div class="child"> 
 

 
    </div> 
 
</div> 
 

 
<div class="other"></div>

相关问题