应用的样式我有下面的div和CSS,如何使用CSS3
.parent:hover{
background-color:violet;
}
.child:hover{
background-color:grey;
}
<div style='border:2px solid red;width:200px;height:100px' class='parent'>
</div>
<div style='margin-top:25px;margin-left:50px;border:2px solid gray;width:100px;height:50px' class='child'>
</div>
这里的时候,我将鼠标悬停背景色紫罗兰已经应用以及父我已经实现了儿童。 但我需要实现当我悬停父母的孩子类也需要适用于相应的div ..以及当我悬停孩子的父类也需要申请在相应的div如何实现?
*当我悬停孩子的父类也需要应用* - 这是不可能的CSS。 – Harry
@Harry当你悬停子元素,那么它已经悬停其父元素,你可以尝试。 –
@HarshSanghani:仔细看问题的结构,然后发表评论:) – Harry