html - Why is it margin: 0 on the paragraph element rather than the div element that contains it? -



html - Why is it margin: 0 on the paragraph element rather than the div element that contains it? -

i have header div want flush against top of window. when enclose paragraph in div, space opens between top of window , div. way close space style paragraph:

div#header p { margin: 0; }

why browser, default, create margin paragraph outside div contains paragraph?

it does, dont worry much it. set code in remove margin if want (like) did.

here reset code if want:

/*remove default margin , padding*/ { margin: 0; padding: 0; } html, body /*so it'll work when specify 100% height on element*/ { height: 100%; }

html css

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -