Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS html body default heights Reply To: html body default heights

#149603
Paulie_D
Moderator

Simply put, the html element is the blank canvas on which everything is drawn.

The body tells the browser that only the elements contained within it are items are to be rendered on the screen.

If the body has no contents and thus no dimensions…setting a background will do nothing.

As soon as you add an element to the body, the background will show up and, because the body element is block level it will be 100% wide (except for any padding assumed by the browser) but only as high as the dimensions of the elements within it.

http://codepen.io/anon/pen/uKvhE