html - 如何将鼠标悬停在我的链接图像上? (它们是 Wordpress 帖子中的图标)

标签 html css wordpress

如何将鼠标悬停在我的链接图像上? (它们是 Wordpress 帖子中的图标)

这是在 Wordpress 帖子中创建的代码。

<p>
    <a href="https://www.pinterest.com/meganpolk/?eq=miss&amp;etslf=2961">
        <img class="alignnone size-full wp-image-739" src="http://misspsstyle.com/wp-content/uploads/2018/05/SM-Icons_01.png" alt="Miss P's Style on Pinterest" width="72" height="72" />
    </a>
    <a href="https://www.facebook.com/MissPsStyle/">
        <img class="alignnone size-full wp-image-740" src="http://misspsstyle.com/wp-content/uploads/2018/05/SM-Icons_02.png" alt="Miss P's Style on Facebook" width="72" height="72" />
    </a>
    <a href="https://www.instagram.com/missps_style/">
        <img class="alignnone size-medium wp-image-741" src="http://misspsstyle.com/wp-content/uploads/2018/05/SM-Icons_03.png" alt="Miss P's Style on Instagram" width="72" height="72" />
    </a>
</p>

最佳答案

要为将鼠标悬停在其中一张图片上时出现的效果添加效果,只需使用 CSS 的伪类 :hover,如下所示:

img:hover {
  background-color: blue; /** This is just to show how it works. Replace the content of this rule with your own styles */
}
<p>
  <a href="https://www.pinterest.com/meganpolk/?eq=miss&amp;etslf=2961">
    <img class="alignnone size-full wp-image-739" src="http://misspsstyle.com/wp-content/uploads/2018/05/SM-Icons_01.png" alt="Miss P's Style on Pinterest" width="72" height="72" />
  </a>
  <a href="https://www.facebook.com/MissPsStyle/">
    <img class="alignnone size-full wp-image-740" src="http://misspsstyle.com/wp-content/uploads/2018/05/SM-Icons_02.png" alt="Miss P's Style on Facebook" width="72" height="72" />
  </a>
  <a href="https://www.instagram.com/missps_style/">
    <img class="alignnone size-medium wp-image-741" src="http://misspsstyle.com/wp-content/uploads/2018/05/SM-Icons_03.png" alt="Miss P's Style on Instagram" width="72" height="72" />
  </a>
</p>

关于html - 如何将鼠标悬停在我的链接图像上? (它们是 Wordpress 帖子中的图标),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50544424/

相关文章:

php - 更改 WooCommerce 'xyz' 类别页面上显示的产品数量

html - CSS 宽度 : inherit issue

javascript - 从图像创建弹出窗口

html - 获取背景图像以垂直拉伸(stretch)

java - jsp中的href标签并通过单击href标签传递数据

css - Webpack sass 加载程序 : How to correctly use fonts?

html - 为什么宽度不是 :auto work

html - 如何用CSS让物体移动?

html - 我可以在不使用 JavaScript 的情况下在将鼠标悬停在元素上时更改图像吗?

javascript - 在 Canvas html/css 旁边放置按钮