CSS: how to prevent link button from changing size when changing border-top and border-bottom?
I want a specific look for my buttons where they kinda look like they're protruding, and would depress when clicked. .button { background: red; color: white; border-top: 0; border-bottom: 0.2em solid orange; padding: 1em; display: inline-block; } .button:active { border-top: 0.2em solid white; border-bottom: 0; } <a class="button" href="">Button 1</a> <a class="button" href="">Button 2</a> Despite the fact that the total height doesn't change, both buttons will drop by 0.2em when I click on either one. The parent container would also gain 0.2em in height. Expected behavior: The clicked button loses the bottom border but gains a white top border, so it looks like it has been depressed (the text will move down with it when clicked). This shouldn't affect the height or position of unclicked buttons. Can anyone give me a hand with this?