0
我有几个图元素,我想在悬停父容器时为标题添加一些简单的悬停效果。但是,这并没有解决,>也没有如下所示,我在那里做错了什么?悬停父元素应编辑子元素外观 - 不起作用
.kategorie_container .product_caption{
margin:0;
width:100%;
position: absolute;
padding: 1vh 2vw;
bottom: 0;
background:white;
transition: 0.2s;
}
.kategorie_container figure:hover .kategorie_container .product_caption {
background:blue;
}
这是它的标记结构:
<figure class="col col-3 ">
<a href="#">
<img src="assets/media/raster/active-pro80-dose_1.jpg" />
<div class="product_caption">
<h6 class="produktname">Productname</h6>
<h6 class="produktpreis">Productprice</h6>
</div>
</a>
</figure>
谢谢!
没有您'figure'元素中类'kategorie_container'没有元素,所以很自然的选择包含'图:悬停.kategorie_container'不匹配任何东西。 – CBroe