Add a pressed effect on button click with CSS

CSSWeb DevelopmentFront End Technology

You can try to run the following code to add a pressed effect on the click of a button


Live Demo

<!DOCTYPE html>
         .button {
            background-color: orange;
            color: white;
            border: none;
            border-radius: 7px;
            box-shadow: 0 5px #999;
            display: inline-block;
            padding: 10px;
            font-size: 16px;
            cursor: pointer;
            text-align: center;
            outline: none;
         .button:hover {
            background-color: blue;
         .button:active {
            background-color: orange;
            box-shadow: 0 5px gray;
            transform: translateY(2px);
      <button class = "button">Result</button>
Updated on 24-Jun-2020 08:29:55