I'm a bit confused about the behavior of display:inline-block
. I noticed that when I use inline-block, it displays content in a smaller space across two tags. However, when I switch to using float: left
, everything works fine.
Does anyone have an idea why there is extra space with inline-block
?
https://i.sstatic.net/G6TpT.png
.main {
padding-top:40px;
padding-left: 40px;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<div class="main">
<span class="btn btn-primary">Primary</span>
<span class="btn btn-success">Success</span>
</div>