我希望悬停结束后隐藏按钮容器

emyy96

**我希望按钮容器在悬停结束后隐藏,当悬停和覆盖出现时,我希望按钮容器可见,当悬停结束时我希望将其隐藏,所以我尝试了可见性:可见但不起作用,我也尝试过(显示:无和显示:块),它也无法正常工作!

.container{
    width:300px;
    height: 300px;
    background-color: red;
    position: relative;
    margin: auto;
}
img{
    display: block;
    width: 100%;
    height: 100%;
  
    /* position: absolute;
    right:0;
    top:0px; */



}
.overlay{
    background-color: grey;
    opacity: 0.5;
    width: 3%;
    height: 100%;
    position: absolute;
    top:0;
    right: 0;
    /* left:100%; */
    transition: width 0.6s ease-out;

}
.container:hover .overlay{
    width: 100%;
    /* left:0% */
}
.overlay a{
    color: white;
    display: block;
    text-decoration: none;
    border-bottom: 5px;
    margin-top: 9px;
}
#button-container{
    visibility: hidden;
  width: 120px;
    height: 30px;
    position: relative;
    background-color: black;
    color: white;
    margin:70px auto;
    text-align: center;
    line-height: 2em;
}
#button-overlay{
    width:10px;
    height: 100%;
    background-color: white;
    position: absolute;
    right: 0;
    top:0;
    transition: width 0.4s;
}

#button-container:hover #button-overlay{
    
    width: 100%;
}

#button-container:hover #button-container{
visibility: visible;}
#button-container:hover #learn-more{
    color: black;
}
<body>
    <div class ="container"> 
       <img src="3.jpeg" alt="">
       <div class="overlay">
           <a href="#" class="social">facebook</a>
           <a href="#" class="social">twitter</a>
           <a href="#" class="social">instagram</a>
           <div id="button-container">
            <a id="learn-more" >learn more</a>
            <div id="button-overlay"></div>
           </div>
          
       </div>

       
    </div>
    
</body>

德鲁维·马克瓦纳(Dhruvi Makvana)

尝试将您的按钮容器从0缩放到1,并具有转换延迟。

.container{
    width:300px;
    height: 300px;
    background-color: red;
    position: relative;
    margin: auto;
}
img{
    display: block;
    width: 100%;
    height: 100%;
  
    /* position: absolute;
    right:0;
    top:0px; */



}
.overlay{
    background-color: grey;
    opacity: 0.5;
    width: 3%;
    height: 100%;
    position: absolute;
    top:0;
    right: 0;
    /* left:100%; */
    transition: width 0.6s ease-out;

}
.container:hover .overlay{
    width: 100%;
    /* left:0% */
}
.overlay a{
    color: white;
    display: block;
    text-decoration: none;
    border-bottom: 5px;
    margin-top: 9px;
}
.container:hover #button-container{
    transform: scale(1);
}
#button-container{
    width: 120px;
    transform: scale(0);
    height: 30px;
    position: relative;
    background-color: black;
    color: white;
    margin:70px auto;
    text-align: center;
    line-height: 2em;
    transform-origin: left top;
    trnasition: all 250ms ease-in-out;
    transition-delay: 250ms;
}
#button-overlay{
    width:10px;
    height: 100%;
    background-color: white;
    position: absolute;
    right: 0;
    top:0;
    transition: width 0.4s;
}

#button-container:hover #button-overlay{
    
    width: 100%;
}

#button-container:hover #button-container{
visibility: visible;}
#button-container:hover #learn-more{
    color: black;
}
<body>
    <div class ="container"> 
       <img src="3.jpeg" alt="">
       <div class="overlay">
           <a href="#" class="social">facebook</a>
           <a href="#" class="social">twitter</a>
           <a href="#" class="social">instagram</a>
           <div id="button-container">
            <a id="learn-more" >learn more</a>
            <div id="button-overlay"></div>
           </div>
          
       </div>

       
    </div>
    
</body>

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

音频结束后隐藏按钮

来自分类Dev

字段填满后,我希望我的按钮调用我的模式

来自分类Dev

我在悬停按钮上的CSS过渡是将容器下推

来自分类Dev

为什么动画结束后我的元素不再隐藏?

来自分类Dev

可以对我的测验实施分数系统吗?我希望测验结束后显示5分

来自分类Dev

我是否希望在选中SPECIFIC单选按钮时显示隐藏的表单元素?

来自分类Dev

单击汉堡图标并调整窗口大小后,导航栏消失(我不希望它隐藏)

来自分类Dev

单击后隐藏按钮

来自分类Dev

单击后隐藏按钮

来自分类Dev

我希望动画在屏幕上水平移动并在按下停止按钮后停止

来自分类Dev

Flutter:我希望选择Textfield时屏幕自动向上滚动,以便不隐藏我的提交按钮?

来自分类Dev

当我将鼠标悬停在按钮上时,我希望新图像描述该按钮,但它正在闪烁

来自分类Dev

为什么当我单击隐藏的容器后,它又没有出现?

来自分类Dev

返回按钮后隐藏片段

来自分类Dev

单击后隐藏提交按钮

来自分类Dev

AngularJS:单击后隐藏按钮

来自分类Dev

Javascript,仅当我单击按钮后,才将鼠标悬停在链接颜色上

来自分类Dev

为什么更改颜色后我的清除按钮/悬停功能不起作用?

来自分类Dev

在ViewContainer中使用按钮隐藏视图容器

来自分类Dev

如何使用按钮来显示/隐藏容器

来自分类Dev

单击按钮后如何隐藏按钮?

来自分类Dev

Android->我希望我的textView在活动中被键盘隐藏

来自分类Dev

滚动结束后使底部按钮成为尖顶

来自分类Dev

角度-音频结束后更改按钮

来自分类Dev

悬停内部元素时如何隐藏容器div标题?

来自分类Dev

单击后,提交按钮保持悬停颜色

来自分类Dev

隐藏/显示按钮未隐藏我的div

来自分类Dev

启用Chrome插件后如何隐藏我网站上图像中的Pin It按钮

来自分类Dev

添加导航栏后,滚动时隐藏我的模式上的关闭按钮

Related 相关文章

  1. 1

    音频结束后隐藏按钮

  2. 2

    字段填满后,我希望我的按钮调用我的模式

  3. 3

    我在悬停按钮上的CSS过渡是将容器下推

  4. 4

    为什么动画结束后我的元素不再隐藏?

  5. 5

    可以对我的测验实施分数系统吗?我希望测验结束后显示5分

  6. 6

    我是否希望在选中SPECIFIC单选按钮时显示隐藏的表单元素?

  7. 7

    单击汉堡图标并调整窗口大小后,导航栏消失(我不希望它隐藏)

  8. 8

    单击后隐藏按钮

  9. 9

    单击后隐藏按钮

  10. 10

    我希望动画在屏幕上水平移动并在按下停止按钮后停止

  11. 11

    Flutter:我希望选择Textfield时屏幕自动向上滚动,以便不隐藏我的提交按钮?

  12. 12

    当我将鼠标悬停在按钮上时,我希望新图像描述该按钮,但它正在闪烁

  13. 13

    为什么当我单击隐藏的容器后,它又没有出现?

  14. 14

    返回按钮后隐藏片段

  15. 15

    单击后隐藏提交按钮

  16. 16

    AngularJS:单击后隐藏按钮

  17. 17

    Javascript,仅当我单击按钮后,才将鼠标悬停在链接颜色上

  18. 18

    为什么更改颜色后我的清除按钮/悬停功能不起作用?

  19. 19

    在ViewContainer中使用按钮隐藏视图容器

  20. 20

    如何使用按钮来显示/隐藏容器

  21. 21

    单击按钮后如何隐藏按钮?

  22. 22

    Android->我希望我的textView在活动中被键盘隐藏

  23. 23

    滚动结束后使底部按钮成为尖顶

  24. 24

    角度-音频结束后更改按钮

  25. 25

    悬停内部元素时如何隐藏容器div标题?

  26. 26

    单击后,提交按钮保持悬停颜色

  27. 27

    隐藏/显示按钮未隐藏我的div

  28. 28

    启用Chrome插件后如何隐藏我网站上图像中的Pin It按钮

  29. 29

    添加导航栏后,滚动时隐藏我的模式上的关闭按钮

热门标签

归档