This is because you have spaces between the button
elements. Change your HTML to:
<div class="buttons"> <button>Button1</button><button>Button2</button> </div>
If you just want to display one line between these button
s, add margin: -1px
.
button { background-color: transparent; border: 1px solid dimgray; width: 150px; height: 40px; margin: -1px; cursor: pointer; }
Additional settings:
In Firefox, when you click the button, a strange dashed frame is displayed, as shown below:

To get rid of this, add this to your CSS:
button::-moz-focus-inner { border: 0; }
One more thing (Firefox): when you click on the button, the text moves. To prevent this, add this to your CSS:
button:active { padding: 0; }
source share