Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>So it appears the page with more content forces the browser window to have a scroll bar, this in turn pushes the centred div to the left as the available area has been reduced by the appearance of the scroll bar.</p> <p>So possible solution is to not have a centred div, ie change the wrap id css to</p> <pre><code>#wrap { width:912px; margin:0 0 0 0; background:Green; } </code></pre> <p>this didnt look to good with what I was working with.</p> <p>Another solution was the overflow, ie adding this</p> <pre><code> html { overflow:scroll; } </code></pre> <p>this actually looks ok, so will probably go with it.</p> <p>I did find another solution using JQuery based on <a href="https://stackoverflow.com/questions/210717/what-is-the-best-way-to-center-a-div-on-the-screen-using-jquery">this</a> </p> <p>update #wrap to</p> <pre><code>#wrap { width:912px; margin:0 0 0 0; background:#fff; visibility: hidden; } </code></pre> <p>then use the following in each page</p> <pre><code> &lt;script type="text/javascript"&gt; jQuery.fn.center = function() { this.css("position", "absolute"); // Use This line On 'Short Page Content' this.css("left", ($(window).width() - (this.width()+18)) / 2 + $(window).scrollLeft() + "px"); // Use This line On 'Long Page Content' this.css("left", ($(window).width() - (this.width())) / 2 + $(window).scrollLeft() + "px"); return this; } $(document).ready(function() { $('#wrap').center(); $('#wrap').css("visibility", "visible"); }); &lt;/script&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