I am facing an issue with extra space between two div elements of class "badge" when displayed vertically in Firefox and IE, while it works fine in Chrome.
I want to ensure that there is either no space or equal space between the div elements in all browsers.
HTML:
<div class="stat-badges">
<div class="badge">
<div class="stat-num">123456</div>
</div>
<div class="badge">
<div class="stat-num">0</div>
</div>
</div>
CSS:
.stat-badges {
text-align: center;
width: 55px;
}
.badge {
display: inline-block;
padding: 2px 4px;
color: #ffffff;
vertical-align: baseline;
white-space: nowrap;
background-color: #999999;
}
.badge .stat-num {
max-width: 30px;
min-width: 20px;
padding: 3px 0;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
The extra space disappears if I remove overflow: hidden;
. However, I need to keep overflow: hidden
for long text cropping using ellipsis
.