我创建了一个网页,其中有三个图像,每个图像占用四列,当鼠标悬停在不同的图像上时,我希望不同的文字出现在不同的图像上。我会很感激帮助。悬停在图像上的文字
我当前的HTML代码如下:
.col-4 {width: 33.33%; float:left;}
.col-4 img {
width: 100%;
max-width: 300px;
height: 300px;
display: inline-block;
}
<div class= "container">
<div class= "overPhotos">
<div class= "row">
<div class="col-4 ">
<img src="rick_sanchez.png" alt="Avatar" class="image">
</div>
<div class="col-4 ">
<img src="morty_smith.png" alt="Avatar" class="image">
</div>
<div class="col-4">
<img src="summer_smith.png" alt="Avatar" class="image">
</div>
</div>
</div>
</div>
欢迎堆栈溢出!预计你至少试图为自己编码。堆栈溢出不是代码写入服务。我建议你做一些[**额外的研究**](http://meta.stackoverflow.com/questions/261592/how-much-research-effort-is-expected-of-stack-overflow-users) ,无论是通过谷歌或通过搜索,尝试和。如果您仍然遇到麻烦,请返回**您的代码**并解释您所尝试的内容。 –
您是否在发布前尝试过搜索此内容?字面上有[数百个类似的问题](https://stackoverflow.com/search?q =文本+悬停+ + +图片)与答案 – FluffyKitten
可能重复的[如何将文本放在HTML图像?](https://stackoverflow.com/questions/5758642/how-to-put-text-over- images-in-html) – godzsa