You have added several other bits to the widths of your elements. The borders will add 2px.
Also browsers add their own default settings for margin/padding.
You will often see at the top of CSS stylesheets:
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
This tells the browser not only not to add its own styling but also if styling is added further down the cascade that padding and border widths should be included in the width of an element. So for example if you set a width at 100px and then add some padding to it it will still have width 100px. This can make calculating how much space is actually being taken up somewhat easier.
However, there is one more thing in the case of inline-blocks - if there is whitespace between them in the layout the browser will add a (small) whitespace between them in laying them side by side. I don't know what the ultimate recommended way of getting rid of this might be (there's lots of options if you search). This snippet just gets rid of the whitespace in the HTML text so it doesn't arise.
* {
padding: 0;
margin: 0;
box-sizing: border-box;
}
.parent {
width: 100%;
border: 1px solid blue;
}
.box {
width: 33.3%;
border: 1px solid red;
display: inline-block;
}
body {
margin: 0px;
padding: 0px;
width: 100vw;
}
<div class="parent"><div class="box">1</div><div class="box">2</div><div class="box">3</div>
</div>