browse by category or date

After frustated unable to get my source codes displayed smaller, I decided to play around with CSS’ font-size for our amusement.

font-familyfont-sizeTarget
Testing Font
Possible value:
Verdana
Arial
Helvetica
Sans-Serif
.. any font installed on your system
Possible values:
pixel, example: 10px 8px
point, example: 8pt
old-school HTML, example: 1 2 3 … 8
ems, example: 0.8em 1em
 

Done using Javascript:

<script language="javascript">

function UpdateFont()
{
    var objTarget = document.getElementById('divtarget'); // a div
    var objSourceFont = document.getElementById('txbFont'); // a textbox
    var objSourceSize = document.getElementById('txbSize'); // a textbox
    if (objTarget != null && objSourceFont != null && objSourceSize != null)
   {
       objTarget.style.fontSize = objSourceSize.value;
       objTarget.style.fontFamily = objSourceFont.value;
   }
}

  </script>

 

Resources:
W3C Standard
W3School Tutorial
 
GD Star Rating
loading...

Possibly relevant:

About Hardono

Howdy! I'm Hardono. I am working as a Software Developer. I am working mostly in Windows, dealing with .NET, conversing in C#. But I know a bit of Linux, mainly because I need to keep this blog operational. I've been working in Logistics/Transport industry for more than 11 years.

Incoming Search

javascript

No Comment

Add Your Comment