Note that there are some explanatory texts on larger screens.

plurals
  1. POSomething wrong with HTML, body and a div
    primarykey
    data
    text
    <p>so I keep having this weird problem that I have never seen before ... as we all know, a div is inside a body and we can make body margin 0 and padding 0 to cover the entire page with height and width 100% ... The problem is, when I try to margin a div inside the body THE ENTIRE BODY moves :S .. and to my surprise if I use firebug and hover over the body, its not the entire page. its just slightly bigger than the dive ... here is the code (first part is HTML, second is CSS)</p> <p>HTML:</p> <pre><code>&lt;!DOCTYPE HTML&gt; &lt;html&gt; &lt;head&gt; &lt;!-- Styles --&gt; &lt;link rel="stylesheet" type="text/css" href="styles/general-style.css"/&gt; &lt;link rel="stylesheet" type="text/css" href="styles/css-buttons.css"/&gt; &lt;link rel="stylesheet" type="text/css" href="styles/css-colors.css"/&gt; &lt;!-- Scripts --&gt; &lt;script type="text/javascript" src="scripts/jquery-1.4.4.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="content"&gt;&lt;/div&gt; &lt;div id="footer"&gt; &lt;!-- footer div starts here --&gt; &lt;/div&gt; &lt;!-- footer div starts here --&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>CSS:</p> <pre><code>html{ } body{ width: 100%; height:100%; padding: 0; margin: 0; } #content{ background: red; margin-left: auto; margin-right: auto; margin-top: 100px height: 350px width:350px } #footer{ margin-left:auto; margin-right:auto; } #footer-text{ font-size:xx-small; margin-top:30px; text-align:center; } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload