我有三个彼此相邻的产品块。每个都有一个图像和下面的名称。当您将鼠标悬停在文本上时,我想要做什么,它会在图像底部显示一个边框。我为图像悬停设置了样式,当我将鼠标悬停在图像上时它可以工作,但当我将鼠标悬停在文本上时它不起作用。
还有我的HTML:
<div class="container-product-row">
<ul class="variations">
<li>
<a href="#"><img src="../images/designs/houses.jpg" alt="" width="180" height="130" /><h2>Cuff</h2></a>
</li>
<li>
<a href="#"><img src="../images/designs/houses.jpg" alt="" width="180" height="130" /><h2>Dome</h2></a>
</li>
<li>
<a href="#"><img src="../images/designs/houses.jpg" alt="" width="180" height="130" /><h2>Gladiator</h2></a>
</li>
</ul>
</div> <!-- container product row -->
CSS:
.container-product-row {
margin-bottom:-20px;
}
.variations li {
margin:10px;
width:183px
}
.variations li a, a:visited {
display: block;
color:#000000;
text-decoration:none
}
.variations li a:hover {
color:#ff4baa;
}
.variations li a img {
display: block;
}
.variations li a img:hover {
border-bottom:5px solid #ff4baa;
}
.variations {
display: block;
}
.variations > li {
display: inline-block;
vertical-align: top;
}
h2 {
font-family: 'Arapey', serif;
font-weight:400;
font-size:12pt;
padding: 5px 10px 5px 5px;
font-style:italic;
font-weight:400
}