Sample:
#wrap {
outline: 1px solid fuchsia;
display: flex;
}
#left {
background: tan;
width: 100%;
}
#right {
background: teal;
width: 50px;
height: 50px;
}
<div id="wrap">
<div id="left"></div>
<div id="right"></div>
</div>
Screenshot:
Questions:
- When I use the browser element inspector, I see the right box is less than
50px
wide although it has a fixed width in the CSS. Why does it basically happen? - How can it be prevented?