如何使链接覆盖整个图像?
P粉481815897
P粉481815897 2024-04-02 20:45:43
0
1
387

我希望链接覆盖所有图像,不仅是在中心,而且当您将鼠标悬停在图像上时。

.moduledata{
  position: relative;
  width: auto;
  margin: 0px !important;
  max-width: 380px;
}
.moduledata > h5 {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%,-50%);
}
.moduledata > h5 > a {
  color: #000000;
  font-weight: 300;
  font-size: 38px;
}
.moduledata:hover h5 {
  visibility: visible;
}
.moduledata h5 {
  visibility: hidden;
}
<div class="moduledata">
  <h5><a href="{{seourl}}">{{title}}</a></h5>
  <figure><img src="{{pageThumb}}"/></figure>
</div>

P粉481815897
P粉481815897

全部回复(1)
P粉191323236

您可以将图像包含在链接内,这样您就可以单击图像上的任意位置来访问该链接。

#comehere {
  margin-top: 2000px;
}

here
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责声明 Sitemap
PHP中文网:公益在线PHP培训,帮助PHP学习者快速成长!