title: Background color won't extend past visible area in a div box with scrollbars
body: <p><strong>[CLOSED]</strong></p>
  
  <p>On <a href="http://glest.wikia.com/wiki/User:Hofmic/sandbox" rel="nofollow noreferrer">this page</a>, there is a div box which holds a code example, where a certain line is supposed to be given a background color. This background color is actually done by using regular expressions to replace a start and end symbol with the code to make a div with our red background. This works fine, we have our red background, the regular expressions are doing their work.</p>
  
  <p>However, if we scroll over a bit in code box, we notice that the red background color stops where the actual edge to the code box is (but we can scroll over, so it's not the end). This should illustrate what I mean:
  <img src="https://i.stack.imgur.com/C2dzj.jpg" alt="Figure One: Our background color terminating before it should be"></p>
  
  <p>I've tried pretty much every CSS value I could think of with firebug, including trying every possible overflow option. With width, if I manually give an absolute width, it can extend it further, but this won't do because the background coloring is generated automatically, with javascript using a method with good fallback in case the javascript fails to load or is disabled.</p>
  
  <p>So, does anyone know a way to get those backgrounds extending all the way to the end? I considered counting the characters, but since the background colors often cover more than a single line, and even hundreds of lines on some other pages, it seems impractical and rather resourcy. A CSS method would be prefered, though should it come to it, I'll go with a javascript fix.</p>
  
  <p>If you want to take a look at the page for yourself, feel free, that one is just a sandbox to show the specific problem, and the script that replaces certain comments with div elements to make this background image is found <a href="http://glest.wikia.com/wiki/MediaWiki:Common.js/SyntaxHighligtBackground.js" rel="nofollow noreferrer">here</a>.</p>
  
  <p>Thanks in advance for any help and/or advice.</p>