Home › Forums › CSS › How do you center div in CSS? › Re: How do you center div in CSS?
April 17, 2013 at 5:49 pm
#132213
Participant
In your first pen: http://codepen.io/ghafirsayed/pen/yJzfp
You could have given `#banner` it’s own block formatting context by setting `overflow: hidden;` or `display: inline-block;`, that would prevent margin-collapsing from `#banner_inner` to `#banner`. For future reference when setting padding on parent is not possible ;)