You are very close to a solution. To achieve the effect, you are trying to use focus and active instead of hover and focus .
The active state is only triggered when an item is clicked.
Here is what i did
.buttons input:focus { outline: none } .buttons input:active { border: 0; background-color: #50627E; outline: none; -webkit-box-shadow: 0 0 1px rgba(0, 0, 0, .75); -moz-box-shadow: 0 0 1px rgba(0, 0, 0, .75); box-shadow: 0 0 1px rgba(0, 0, 0, .75); }
You can check the complete solution below:
.form input:focus { background: #FFFFAD; outline: none; } .buttons { text-align: left; } .buttons input { font-size: 2.5em; font-weight: bold; font-family: "Arial", serif; padding: 8px 40px; background: #4470B6; border: 0px; margin-left: 0px; margin-right: 50px; margin-top: 50px; -moz-border-radius: 50px; -webkit-border-radius: 50px; border-radius: 50px; -webkit-box-shadow: 0 0 4px rgba(0, 0, 0, .75); -moz-box-shadow: 0 0 4px rgba(0, 0, 0, .75); box-shadow: 0 0 4px rgba(0, 0, 0, .75); color: #FFFAFA; } .buttons input:focus { outline: none } .buttons input:active { border: 0; background-color: #50627E; outline: none; -webkit-box-shadow: 0 0 1px rgba(0, 0, 0, .75); -moz-box-shadow: 0 0 1px rgba(0, 0, 0, .75); box-shadow: 0 0 1px rgba(0, 0, 0, .75); }
<section class="details"> <form id="form" action="test.php" method="post" autocomplete="on" target="_blank"> <div class="form"> <label>First Name:</label> <input type="text" name="firstname" placeholder="First Name" autofocus /> </div> <div class="buttons"> <input type="submit" value="Search"> <input type="reset" value="Reset"> </div> </form> </section>
source share