如何用母版制作翻页卡?

时间:2018-12-29 21:40:14

标签: c# css asp.net

无论我怎么尝试,我都试图制作一张翻转卡,因为我有一个母版页,所以将其放在asp:content标记中根本无法使用。 注意:我尝试了没有母版页的相同代码,但效果很好。 我的代码是:

<asp:Content ID="Content4" ContentPlaceHolderID="Body" runat="server">
<div class="flip-card">
  <div class="flip-card-inner">
    <div class="flip-card-front">
      <img src="img_avatar.png" alt="Avatar" style="width:300px;height:300px;">
    </div>
    <div class="flip-card-back">
      <h1>John Doe</h1> 
      <p>Architect & Engineer</p> 
      <p>We love that guy</p>
    </div>
  </div>
</div>

</asp:Content>

我的CSS样式:

<style>
body {
  font-family: Arial, Helvetica, sans-serif;
}

.flip-card {
  background-color: transparent;
  width: 300px;
  height: 300px;
  perspective: 1000px;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.6s;
  transform-style: preserve-3d;
  box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);
}

.flip-card:hover .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-card-front, .flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
}

.flip-card-front {
  background-color: #bbb;
  color: black;
  z-index: 2;
}

.flip-card-back {
  background-color: #2980b9;
  color: white;
  transform: rotateY(180deg);
  z-index: 1;
}
</style>

我尝试了Internet上的多个修复程序,其中大多数来自stackoverflow,但没有任何反应,错误仍然存​​在。 发生的情况是,当我将鼠标悬停在图片上时,必须显示翻转卡类上的数据,并且翻转卡正面中的图片必须消失,而发生的所有事情都是翻转翻转卡类并显示背面。希望有人能帮忙。

0 个答案:

没有答案