为什么我的悬停按钮在悬停时弹出?

问题描述

谁能知道为什么我的鼠标悬停时弹出。我尽力修复,但是吗? 我正在使用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>

解决方法

您写的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>

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...