html - How to increase the duration of :active in css? -


so want green background color stay longer button being pressed. possible?

#button {    background-color: red;    width: 100px;    height: 50px;    display: block;  }  #button:active {    background-color: green;  }
<!doctype html>    <html lang="en">    <head>    <meta charset="utf-8" />    <title></title>    </head>    <body>    <a href="#" id="button">1</a>     </body>    </html>

it possible use transition

#button {    background-color: red;    width: 100px;    height: 50px;    display: block;    transition:0s 1s;  }  #button:active {    background-color: green;    transition:0s;  }
<!doctype html>    <html lang="en">    <head>    <meta charset="utf-8" />    <title></title>    </head>    <body>    <a href="#" id="button">1</a>     </body>    </html>


Comments

Popular posts from this blog

gcc - MinGW's ld cannot perform PE operations on non PE output file -

timeout - Handshake_timeout on RabbitMQ using python and pika from remote vm -

c# - Search and Add Comment with OpenXML for Word -