html - 悬停时 IMG 链接覆盖

标签 html css image

<分区>


想改进这个问题吗? 更新问题,使其只关注一个问题 editing this post .

关闭 5 年前

我想知道如何在带有链接的 img 上设置绿色覆盖。

<section>
  <div class='container>
    <div class='row'>
      <a href ='https://stackoverflow.com/' target="_blank">
        <img src="i cant cause i need at least 10 rep to post images">
      </a>
    </div>
  </div>
</section>

只有 css 或 bootstrap4,没有框架。 谁能帮忙? :)

最佳答案

您可以为此使用纯 css。这将使您的图像背景在悬停时变为绿色。

img{
    width:50px;
    height:50px;
    background-image: url("URL TO IMAGE");
}

img:hover{
   background-color: green;
   background-blend-mode: multiply;
}

关于html - 悬停时 IMG 链接覆盖,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49283906/

上一篇:javascript - 如何通过 jQuery 滑动切换下拉菜单项?

下一篇:javascript - 平均应用程序 : Can't find theme in Angular material

相关文章:

javascript - 一次性全部展开

html - 显示和隐藏 HTML 部分

html - 在 primeng 面板小部件中将按钮拉到面板标题的右侧

html - 将 img 添加到 div 作为背景

android - 加载一张图片时出现内存不足错误

image - 使用WiX时,为什么我的MSI图像看起来损坏了?

html - 在CSS中覆盖子类中的父设置

html - Rails 命名空间路由问题

html - W3C 验证程序错误 : Parse Error opacity=60

css - 如何使用 highcharts 实现此图