I have a container with two children that I would like to display inline. Think it like a container element that has an agreement text on it.
Here is the codepen that shows the current code: https://codepen.io/alansouzati/pen/yXPrvQ
The problem is that I cannot figure out how to properly display the label side-by-side with the checkbox in a way that it would not overflow. These texts tend to be long and this is where the problem shows.
Currently I'm seeing a horizontal scroll inside the box that I have no idea where it is coming from.
Any ideas what I'm missing in the code?
.container {
width: 288px;
border: 1px solid;
padding: 6px 24px;
display: block;
white-space: nowrap;
overflow: auto;
}
.checkbox,
.label {
display: inline-block;
}
.checkbox {
width: 12px;
margin-right: 12px;
}
.label {
word-break: break-word;
white-space: normal;
vertical-align: middle;
width: calc(100% - 24px)
}