2016-09-21 178 views

回答

0

.box1 , .box2 , .box2:after{ 
 
\t width: 100px; 
 
\t height: 100px; 
 
\t background-color: #ccc; 
 
\t margin: 10px; 
 
\t display: inline-block; 
 
} 
 

 
.box2:after { 
 
\t content: 'Box2:after'; 
 
\t position: relative; 
 
\t display: inline-block; 
 
\t left: 200px; 
 
\t top: -30px; 
 
} 
 

 
.box1:hover ~ .box2:after { 
 
\t background-color: red 
 
}
<div class="box1">BOX 1:hover my</div> 
 
<div class="box2">Box 2</div>

相關問題