Changes

Useful CSS Code Snippets

678 bytes added, 16:29, 13 February 2015
/* Resizing of Web Page Elements to Browser size */
The following lines were added (+) and removed (-):
For elements to fill a page, the body of the page has to be the full browser height.  To make a vertical element that fills the page, first make the page fill the browser <body> html { height: 100%; } body { margin: 0; padding: 0; height: 100%; } #content { background: #D00; border-left: 1px solid #000; border-right: 1px solid #000; padding: 0 20px 0 20px; margin: auto; font: 1.5em arial, verdana, sans-serif; width: 960px; min-height: 100%; }Make sure you use #content div "min-height: 100%" instead of "height: 100%" so that if the content of the #content div extends beyond the height of the window, the background will expand as well.
Bureaucrat, administrator
16,192
edits