At the moment, I am dealing with a flex-row that contains an element that grows with the available space and a badge that should be aligned to the end without growing. However, when using flex-grow: 0 in IE11, the span.badge does not even take up the width of its content. Do you have any suggestions on how to make the span.badge size itself according to its content?
Codepen: https://codepen.io/anon/pen/gvmwNY
#sector-form-wrapper {
width: 500px;
padding: 1rem;
}
.form-check-with-badge {
display: flex;
flex-direction: row;
margin-bottom: 0.2rem;
line-height: 1.5rem;
justify-content: space-between;
align-items: center;
}
.form-check-with-badge .form-check {
flex: 1;
}
.form-check-with-badge .form-check label {
width: 100%;
}
.form-check-with-badge .badge {
flex: 0;
}
.form-check-with-badge .badge {
color: #fff;
padding-top: 0.4rem;
padding-bottom: 0.4rem;
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-beta.3/css/bootstrap.css" rel="stylesheet" />
<div id="sector-form-wrapper" class="">
<div class="form-check-with-badge">
<div class="form-check"><label class="form-check-label"><input type="checkbox" class="form-check-input" value="Apt">
Apartment
</label></div> <span class="badge badge-pill" style="background-color: rgb(0, 128, 128);">
344
</span></div>
(remaining code here)
</div>