Thursday, December 6, 2012

style.letterSpacing

Properti style.letterSpacing digunakan untuk menetapkan tambah atau kurang jarak spasi antar karakter.

Sintaks:

obj.style.letterSpacing: value;

Nilainya:

  • normal (default)
  • Length
  • inherit

Contoh:

<HTML> <HEAD> <TITLE>style.letterSpacing</TITLE> <SCRIPT TYPE="text/javascript"> function changeletterSpacing() { document.getElementById("myp").style.letterSpacing = "10px"; } </SCRIPT> </HEAD> <BODY> <P ID="myp">Lorem ipsum...Lorem ipsum...Lorem ipsum...Lorem ipsum...Lorem ipsum... Lorem ipsum...Lorem ipsum...Lorem ipsum...Lorem ipsum...Lorem ipsum... Lorem ipsum...Lorem ipsum...Lorem ipsum...Lorem ipsum...Lorem ipsum... Lorem ipsum...Lorem ipsum...Lorem ipsum...Lorem ipsum...Lorem ipsum... Lorem ipsum...Lorem ipsum...Lorem ipsum...Lorem ipsum...Lorem ipsum...</P> <BUTTON TYPE="button" ONCLICK="changeletterSpacing()">Change letter spacing!</BUTTON> </BODY> </HTML>