【发布时间】:2020-02-25 20:36:29
【问题描述】:
我正在尝试在图标后面放置一个形状,因此当您将鼠标悬停时,该形状将显示在图标后面。这是我的html代码:
<div class="icon">
<a class="hover1" href="#">
<img src="images/marketing.png" alt="Marketing icon">
</a>
<h3>Marketing</h3>
</div>
这是 CSS:
.icon .hover1:hover {
background-image: url(images/marketing_2.png);
background-repeat: no-repeat;
background-position: center bottom;
background-size: cover;
}
目前该形状未正确显示。不知道现在该怎么做,因为我对这一切都很陌生。
Icon with text underneath
Shape I want to place behind icon when I hover
【问题讨论】:
-
寻求代码帮助的问题必须包含重现它所需的最短代码在问题本身中最好在Stack Snippet 中。见How to create a Minimal, Reproducible Example
-
为什么我怀疑你的营销图标不透明?