Heim  >  Fragen und Antworten  >  Hauptteil

Wie kann ich dafür sorgen, dass der Link das gesamte Bild abdeckt?

Ich möchte, dass der Link alle Bilder abdeckt, nicht nur in der Mitte, sondern auch, wenn Sie mit der Maus über das Bild fahren.

.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粉481815897P粉481815897181 Tage vor394

Antworte allen(1)Ich werde antworten

  • P粉191323236

    P粉1913232362024-04-03 18:08:52

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

    #comehere {
      margin-top: 2000px;
    }
    
    
    here

    Antwort
    0
  • StornierenAntwort