【问题标题】:Why is my rollover button popping on hover?为什么我的翻转按钮在悬停时弹出?
【发布时间】:2021-01-25 07:33:28
【问题描述】:

谁能知道为什么我的翻车会在悬停时弹出。我非常努力地修复,但真的吗? 我正在使用 css .hover 函数,请参见下面的示例。 任何建议或例子都会感谢我,谢谢炖

    }   
body {
background-color: grey;
background: url(http://wizzfree.com/pix/bg1.jpg) fixed;
background-size: 100% 100%;
background-repeat: no-repeat;
overflow: hidden;
margin: 0px;
    
    font-family: Arial;
    color: darkgrey;
    font-size: 12px;
    line-height: .3;
    letter-spacing: .5px;
}
  .call {
    position: fixed;
    top: 180px;
    left: 50%;
    width: 150px;
    height:123px;
    transform:translateX(-50%); /* center */
    z-index: 3;
}
/*........ crossfade on buttons ........*/

    .hover img{
    transition:.3s;
    position:absolute;
}
    .nohover{
    opacity:0;}
    a:hover .hover{
    opacity:0;
}
    a:hover .nohover{
    opacity:1;
}
    .hover {
    position: relative;
}
    .hover img{
    position: absolute;
}
<div class="call">
<a href="startchat.htm">
<img src="http://wizzfree.com/pix/call2.png" width="150" class="nohover">
<img src="http://wizzfree.com/pix/call3.png" width="150" class="hover"></a>
</div>

【问题讨论】:

    标签: html css button hover rollover


    【解决方案1】:

    你的 CSS 写错了。用下面的 CSS 替换你的 CSS。

    body {
      background-color: grey;
      background: url(http://wizzfree.com/pix/bg1.jpg) fixed;
      background-size: 100% 100%;
      background-repeat: no-repeat;
      overflow: hidden;
      margin: 0px;
      font-family: Arial;
      color: darkgrey;
      font-size: 12px;
      line-height: .3;
      letter-spacing: .5px;
    }
    .call {
        position: fixed;
        top: 180px;
        left: 50%;
        width: 150px;
        height:123px;
        transform:translateX(-50%); /* center */
        z-index: 3;
    }
    
    .hover,.nohover{
        transition:.3s;
        position:absolute;
    }
    .nohover{
        opacity:0;
    }
    a:hover .hover{
        opacity:0;
    }
    a:hover .nohover{
        opacity:1;
    }body {
      background-color: grey;
      background: url(http://wizzfree.com/pix/bg1.jpg) fixed;
      background-size: 100% 100%;
      background-repeat: no-repeat;
      overflow: hidden;
      margin: 0px;
      font-family: Arial;
      color: darkgrey;
      font-size: 12px;
      line-height: .3;
      letter-spacing: .5px;
    }
    .call {
        position: fixed;
        top: 180px;
        left: 50%;
        width: 150px;
        height:123px;
        transform:translateX(-50%); /* center */
        z-index: 3;
    }
    
    .hover,.nohover{
        transition:.3s;
        position:absolute;
    }
    .nohover{
        opacity:0;
    }
    a:hover .hover{
        opacity:0;
    }
    a:hover .nohover{
        opacity:1;
    }
    <div class="call">
      <a href="startchat.htm">
      <img src="http://wizzfree.com/pix/call2.png" width="150" class="nohover">
      <img src="http://wizzfree.com/pix/call3.png" width="150" class="hover"></a>
    </div>

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-05-26
      • 2014-12-27
      • 2016-08-30
      • 1970-01-01
      • 2014-01-25
      • 2021-11-24
      • 2017-06-11
      • 2019-10-23
      相关资源
      最近更新 更多