Can I have an onclick effect in CSS?

后端 未结 12 1757
悲&欢浪女
悲&欢浪女 2020-11-21 06:42

I have an image element that I want to change on click.


This works:

#btnLeft:hover {
    width:7         


        
12条回答
  •  有刺的猬
    2020-11-21 07:16

    I have the below code for mouse hover and mouse click and it works:

    //For Mouse Hover
    .thumbnail:hover span{ /*CSS for enlarged image*/
        visibility: visible;
        text-align:center;
        vertical-align:middle;
        height: 70%;
        width: 80%;
        top:auto;
        left: 10%;
    }
    

    and this code hides the image when you click on it:

    .thumbnail:active span {
        visibility: hidden;
    }
    

提交回复
热议问题