Why is the blue color protruding outside to the right of the green container?

Because of the border on the elements. You can add box-sizing: border-box to all elements to get more reasonable size calculations.

* {
  box-sizing: border-box

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.