Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy does the content of this page shift a few pixels to the left/right?
    text
    copied!<p>I'm using a "Centred Header/Footer/2 column CSS" layout.</p> <p>In test1.htm if their is minimal page content and the page footer is fully visible within the browser window then when you click on test2.htm the page content shifts to the left.</p> <p>If test1.htm has enough content to push the footer off the bottom of the browser window then when you click on test2.htm the page content stays static.</p> <p>Can anyone help with this css issue?</p> <p>test1.htm</p> <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml" &gt; &lt;head&gt; &lt;title&gt;&lt;/title&gt; &lt;style type="text/css"&gt; body, html { margin:0; padding:0; font-size: 1em; font-family: Verdana, Arial, Helvetica, sans-serif; } #wrap { width:912px; margin:0 auto; background:Green; } #header { background-color:Gray; height: 120px; } #leftColumn { float:left; width:230px; padding: 0 10px 10px 10px; background:Red; } #rightColumn { float:right; width:642px; padding:10px; background:#fff; font-size: 0.7em; color: #828589; } #footer { clear:both; padding:5px 10px; background-color:Gray; } &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="wrap"&gt; &lt;div id="header"&gt; &lt;div id="nav"&gt; &lt;a href="test1.htm"&gt;test1&lt;/a&gt; &lt;a href="test2.htm"&gt;test2&lt;/a&gt; &lt;/div&gt; &lt;/div&gt; &lt;div id="leftColumn"&gt; &lt;p&gt; left column &lt;/p&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; &lt;/div&gt; &lt;div id="rightColumn"&gt; &lt;div id="PageContent"&gt; &lt;!-- START PAGE CONTENT --&gt; &lt;h1&gt;Page Title &lt;/h1&gt; &lt;h4&gt;"test 1 "&lt;/h4&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; some words... &lt;!-- &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; --&gt; &lt;!-- END PAGE CONTENT --&gt; &lt;/div&gt; &lt;/div&gt; &lt;div id="footer"&gt; the footer &lt;/div&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>test2.htm</p> <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml" &gt; &lt;head&gt; &lt;title&gt;&lt;/title&gt; &lt;style type="text/css"&gt; body, html { margin:0; padding:0; font-size: 1em; font-family: Verdana, Arial, Helvetica, sans-serif; } #wrap { width:912px; margin:0 auto; background:Green; } #header { background-color:Gray; height: 120px; } #leftColumn { float:left; width:230px; padding: 0 10px 10px 10px; background:Red; } #rightColumn { float:right; width:642px; padding:10px; background:#fff; font-size: 0.7em; color: #828589; } #footer { clear:both; padding:5px 10px; background-color:Gray; } * html #footer { height:1px; } &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="wrap"&gt; &lt;div id="header"&gt; &lt;div id="nav"&gt; &lt;a href="test1.htm"&gt;test1&lt;/a&gt; &lt;a href="test2.htm"&gt;test2&lt;/a&gt; &lt;/div&gt; &lt;/div&gt; &lt;div id="leftColumn"&gt; &lt;p&gt; left column &lt;/p&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; &lt;/div&gt; &lt;div id="rightColumn"&gt; &lt;div id="PageContent"&gt; &lt;!-- START PAGE CONTENT --&gt; &lt;h1&gt;Page Title &lt;/h1&gt; &lt;h4&gt;"test 2 "&lt;/h4&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; some words... &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; some words... &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; &lt;!-- END PAGE CONTENT --&gt; &lt;/div&gt; &lt;/div&gt; &lt;div id="footer"&gt; the footer &lt;/div&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
 

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