title: Font size relative to container
body: <p>i am designing a site that adjusts itself to the window size, and i need to make the text size relative to it's container (a div). I searched about doing it with css, and found out that it is not possible. So i am trying with JavaScript, but i am not a JavaScript programmer. So i searched each piece of the code i needed and compiled it to this:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      $(document).ready(function() {
          while(true) {
              document.getElementById("text").style.fontSize = $("container").height();
          }
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>(the "while" is to re-size it constantly, considering that the user might re-size the window)</p>
  
  <p>I put the script in the "head" tag, and it doesn't work. I don't know if the script is wrong, or if it is not running. What am i doing wrong?
  Also i want to put a delay in the end of the script, to avoid it running like crazy, but i don't know how to do that.</p>
  
  <p>Thanks in advance,</p>
  
  <p>Luca</p>
  
  <p>Thanks to the answers, but nothing working.
  I guess that the script is not running, what can be wrong??? Please help!</p>