title: Javascript: execcommand fontsize in px
body: <p>all.. I do know that this question is kind of scattered over the internet, but nothing seems to be pointing me right.</p>
  
  <p>I am making my own wysiwyg and the problem I'm facing is that the code </p>
  
  <pre><code>document.execCommand("fontSize", false, value);
  </code></pre>
  
  <p>accepts only values from 1 to 7 (inclusive) to be assigned to the "size" attribute of "font" tag. However I need to set the font-size in <em>pixels</em>.</p>
  
  <p>I found <a href="http://jsfiddle.net/S3ctN/55/" rel="nofollow noreferrer">this</a> example in a similar <a href="https://stackoverflow.com/questions/5868295/document-execcommand-and-fontsize-in-pixels">stackoverflow question</a>. But the problem with this approach is that it only changes the font-size for the selected text. if you aim to set the font-size before typing your text, it will not work.</p>
  
  <p>Does any one have any idea how I can solve this?</p>