I want two buttons to be displayed right next to each other, with no border in between. The buttons are:
<button class="tButton">1</button>
<button class="tButton">2</button>
My naive approach for the css is:
.tButton {
width: 50px;
height: 50px;
margin:0px;
padding: 0px;
background-color: gray;
border: none;
}
But this leaves some space between the buttons (JSFiddle). In Firefox, the example renders as:
This problem goes away when I use float: left;
on the buttons. But I am trying to understand the following about CSS:
Why is there any margin to begin with, even though I explicitly set margin: 0;
?