鼠标悬浮效果背景图标被背景颜色遮挡怎么解决?

图片.png
图片.png

.tx_mmenu_together .donate-btn-header .lytop_search {
    height: 40px;
    margin: 0;
    padding: 0;
    float: left;
    position: relative;
    z-index: 1;
}

.tx_mmenu_together .donate-btn-header .lytop_search form {
    width: 60px;
    height: 40px;
    margin: 0;
    padding: 0;
    position: relative;
}

.tx_mmenu_together .donate-btn-header .lytop_search form .sc_ipt {
    width: 0;
    height: 40px;
    overflow: hidden;
    margin: 0;
    padding: 0;
    position: absolute;
    left: 0;
    top: 0;
    transition: all 0.5s;
    -webkit-transition: all 0.5s;
    -moz-transition: all 0.5s;
    -o-transition: all 0.5s;
}

.tx_mmenu_together .donate-btn-header .lytop_search form .sc_ipt input {
    display: block;
    width: 100%;
    height: 40px;
    overflow: hidden;
    line-height: 40px;
    color: #999999;
    font-size: 14px;
    margin: 0;
    padding: 0 14px;
    background-color: #fff;
    border-radius: 20px 0 0 20px;
    border: 1px solid #dfdfdf;
    border-right: 0;
    outline: none;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

.tx_mmenu_together .donate-btn-header .lytop_search form .sc_btn {
    width: 60px;
    height: 40px;
    overflow: hidden;
    margin: 0;
    padding: 0;
    border-radius: 0 20px 20px 0;
    float: right;
}

.tx_mmenu_together .donate-btn-header .lytop_search form .sc_btn input {
    display: block;
    width: 60px;
    height: 40px;
    overflow: hidden;
    margin: 0;
    padding: 0;
    background: #fff url('../img/home/search.png') center center no-repeat;
    background-size: 40px 40px;
    border: 0;
    outline: none;
    cursor: pointer;
}
.tx_mmenu_together .donate-btn-header .lytop_search:hover form .sc_ipt {
    width: 260px;
    left: -260px;
}
.tx_mmenu_together .donate-btn-header .lytop_search:hover form .sc_btn input {
    background: #1a75bc url('../img/home/search-.png') center center no-repeat;
}
阅读 771
2 个回答

图片地址不一致

.tx_mmenu_together .donate-btn-header .lytop_search form .sc_btn input {
    background: #fff url('../img/home/search.png') center center no-repeat;
}
.tx_mmenu_together .donate-btn-header .lytop_search:hover form .sc_btn input {
    background: #1a75bc url('../img/home/search-.png') center center no-repeat;
}

像这种情况下直接改background-color就够了

.tx_mmenu_together .donate-btn-header .lytop_search:hover form .sc_btn input {
    background-color: #1a75bc;
}
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题
宣传栏