需要解决将鼠标悬停在按钮上方的问题?

问题描述

当我将鼠标悬停在上方时,我需要帮助来修复我的笑脸按钮并弹出的错误(请参见下面的示例)。我认为问题与.chatBox / form字段内或悬停的笑脸有关。也可能与div样式的最小/最大宽度详细信息等有关。

在这里,任何建议或示例都将不胜感激。 Thx耐嚼

<!doctype html>
<html>
<head>
<Meta charset="utf-8">
<title>Home</title>
<link rel="icon" type="image/png" href="pix/icon.png" />
<style type="text/css" href="/fonts">
    html {scroll-behavior: smooth;}
    @font-face {
    font-family: vag;
    src: url(fonts/VAGRoundedStd-Light.otf);
}   
    body {
    background-color: grey;
    background-image: url(pix/bg1.png),url(pix/bg2.png);
    background-size: 1100px 100vh;
    background-position: left top,right top;
    background-repeat: no-repeat;
    overflow: hidden;
    margin: 0px;
    
    font-family: Arial;
    color: darkgrey;
    font-size: 12px;
    line-height: .3;
    letter-spacing: .5px;
}
    .logo {
    position: absolute;
    top: 20px;
    left: 3%;
}
    .cam {
    position: absolute;
    top: 20px;
    right: 3%;
    border-radius: 60px;
}
    .livestream {
    object-fit:cover;
    height: 100vh;
    max-width: 100%;
    display: block;
    margin: auto;
}
    /*............... chatBox ...............*/
    
    .chatBox {
    position:fixed;
    bottom: 80px;
    left: 50%; 
    transform:translateX(-50%); /* center */
    width:50vw;
    height:42px;
    background-color: #2f2f2f;
    border-radius: 0px 30px 30px 0px;
    z-index: 3;
}
    /*... input message ...*/
    
    input[type=text] {
    width: 100%;
    height: 40px;
    border: none;
    outline: none;
    padding-left: 37px;
    font-family: vag;
    color: white;
    font-size: 16px;
    font-weight: bold;
    letter-spacing: 1.5px;
    background-color:transparent;
}
    /*............. footer bar.............*/
    
    .footerbar {
    position: fixed;
    border-radius: 50px 50px 0 0;
    bottom: 0px;
    width: 100%;
    height: 100px;
    background-color: rgba(0,0.4);
    backdrop-filter: blur(20px);
    -ms-backdrop-filter: blur(20px);
    -moz-backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 2;
}
    /*........ crossfade on buttons ........*/

    #hover img{
    transition:.3s;
    position:absolute;
}
    .nohover{
    opacity:0;}
    a:hover .hover{
    opacity:0;
}
    a:hover .nohover{
    opacity:1;
}
<img class="logo" src="pix/logo.png" width="100">
<img class="cam" src="pix/cam.jpg" width="117">
<img class="livestream" src="http://wizzfree.com/pix/bg1a.jpg">



<!--................ chatBox ..................-->

<div class="chatBox" style="min-width:400px;max-width:600px;display:flex;margin-left:15px;">
<!-- emojis gallery -->
<a class="hover" href="emojis.htm">
<img src="http://wizzfree.com/pix/smiley.png" height="42" style="margin-left:-32px;">
<img src="http://wizzfree.com/pix/smiley2.png" height="42" class="nohover" style="margin-left:-32px;">
<img src="http://wizzfree.com/pix/smiley.png" height="42" class="hover" style="margin-left:-32px;">
</a>
<!-- input message -->
<input type="text" id="fname" name="fname" value="Type Your Message" onFocus="this.value=''">
<!-- typing on/off -->
<p style="margin-top:18px;margin-right:15px;color:#ff6f6f;font-family:vag;font-size:16px;letter-spacing:1.5px;"><em><strong>Typing...</strong></em></p>
</div>

解决方法

    html {scroll-behavior: smooth;}
    @font-face {
    font-family: vag;
    src: url(fonts/VAGRoundedStd-Light.otf);
}   
    body {
    background-color: grey;
    background-image: url(pix/bg1.png),url(pix/bg2.png);
    background-size: 1100px 100vh;
    background-position: left top,right top;
    background-repeat: no-repeat;
    overflow: hidden;
    margin: 0px;
    
    font-family: Arial;
    color: darkgrey;
    font-size: 12px;
    line-height: .3;
    letter-spacing: .5px;
}
    .logo {
    position: absolute;
    top: 20px;
    left: 3%;
}
    .cam {
    position: absolute;
    top: 20px;
    right: 3%;
    border-radius: 60px;
}
    .livestream {
    object-fit:cover;
    height: 100vh;
    max-width: 100%;
    display: block;
    margin: auto;
}
    /*............... chatbox ...............*/
    
    .chatbox {
    position:fixed;
    bottom: 80px;
    left: 50%; 
    transform:translateX(-50%); /* center */
    width:50vw;
    height:42px;
    background-color: #2f2f2f;
    border-radius: 0px 30px 30px 0px;
    z-index: 3;
}
    /*... input message ...*/
    
    input[type=text] {
    width: 100%;
    height: 40px;
    border: none;
    outline: none;
    padding-left: 37px;
    font-family: vag;
    color: white;
    font-size: 16px;
    font-weight: bold;
    letter-spacing: 1.5px;
    background-color:transparent;
}
    /*............. footer bar.............*/
    
    .footerbar {
    position: fixed;
    border-radius: 50px 50px 0 0;
    bottom: 0px;
    width: 100%;
    height: 100px;
    background-color: rgba(0,0.4);
    backdrop-filter: blur(20px);
    -ms-backdrop-filter: blur(20px);
    -moz-backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 2;
}
    /*........ crossfade on buttons ........*/

    #hover img{
    transition:.3s;
    position:absolute;
}
.hover img.nohover{
position: absolute;
top: 0;
left: 0;
}
    .nohover{
    opacity:0;}
    a:hover .hover{
    opacity:0;
}
    a:hover .nohover{
    opacity:1;
}
<img class="logo" src="pix/logo.png" width="100">
<img class="cam" src="pix/cam.jpg" width="117">
<img class="livestream" src="http://wizzfree.com/pix/bg1a.jpg">



<!--................ chatbox ..................-->

<div class="chatbox" style="min-width:400px;max-width:600px;display:flex;margin-left:15px;">
<!-- emojis gallery -->
<a class="hover" href="emojis.htm">
<img src="http://wizzfree.com/pix/smiley.png" height="42" style="margin-left:-32px;">
<img src="http://wizzfree.com/pix/smiley2.png" height="42" class="nohover" style="margin-left:-32px;">
</a>
<!-- input message -->
<input type="text" id="fname" name="fname" value="Type Your Message" onFocus="this.value=''">
<!-- typing on/off -->
<p style="margin-top:18px;margin-right:15px;color:#ff6f6f;font-family:vag;font-size:16px;letter-spacing:1.5px;"><em><strong>Typing...</strong></em></p>
</div>

是您想要的吗?

,

应用以下CSS:

.hover {
   position: relative;
}
.hover img{
   position: absolute;
}

相关问答

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