I am using calc() to measure the available width of the input after subtracting the width of the sibling elements.
<div class="containero">
<button class="noey">No</button>
<input class="inpoot" />
<button class="yeso">Yes</button>
</div>
And I have the following CSS.
.containero {
width: 100%;
background-color: yellow;
display: inline-block;
box-sizing:border-box;
}
.noey, .yeso {
border: 1px solid red;
width: 30px;
height: 30px;
text-align: center;
vertical-align: middle;
display:inline-block;
color: red;
padding:0px;
box-sizing:border-box;
}
.inpoot {
height: 31px;
margin: 0 5px;
display:inline-block;
width: calc(100% - 70px);
box-sizing:border-box;
}
Now as per my calculations, the element .inpoot should fit in nice and cosy if I set its width to calc(100% - 70px); taking into account the widht of 30px for both the siblings, and then its own margin of 10px. But to my utter dismay, life isn't easy its not working as expected. The last sibling, .yeso is being pushed to next line.
BUT!!! if I set the .inpoot width to calc(100% - 82px) voila!! it works, but I am flabbergasted where on GOD's beautiful earth, is that additional width coming from?