I learned recently that I can center a div on the page (even when the window is resized) by doing margin-left:auto;margin-right:auto
. This is great, and I can't believe I didn't know it. However, it seems to affect child divs so that they no longer accept margins normally.
Why is it that #header_text
does not move down 15px from the top and left of #CBS_content_container
. Instead it takes its margins using the window as its origin. Like, if I change #header_text{margin:150px;}
, it will shift things around wildly.
Thanks for any help; I'm sure this is simple!