If you add position:absolute; or float:left; in #outer , the size will be equal to two inner div . For this example, I would use a float . Floats are usually better for content that can change or expand / shrink with changes over time, while absolute positioning should be used outside the document flow or document structure, for example, in the navigation bar.
Edit: if you don't need other elements to wrap around the outer div , the display:inline-block method posted below will work, but if you have elements that you want to wrap around #outer , then float:left will be the path. Say you have #outer as 50% of the width and want something else on the other half of the page, using display:inline-block , place the other elements below #outer .
CodePen link to show the difference
DC319 source share