The best way is to click on the button below on the page. Using transformY would be the easiest. However, this can ruin the location of other things on the page. Therefore, I think itβs better to use margin to temporarily lower the button, for example,
button { vertical-align: top; box-shadow: 2px 1px 2px gray; margin: 4px 10px 4px 10px; } button:active { box-shadow: 0 0 0 white; margin: 6px 10px 2px 10px; }
<button>click me</button> <button>click me</button> <button>click me</button>
As in the example, you can remove 2px from the bottom field and add 2px to the top, so you keep the total size of the button.
You need to vertically align if there is more than one button.
source share