Javascript examples for CSS Style Property:letterSpacing
The letterSpacing property sets or gets the space between characters.
Value | Description |
---|---|
normal | Normal space between characters. This is default |
length | Defines the space in length units. Negative values are allowed |
initial | Sets this property to its default value. |
inherit | Inherits this property from its parent element. |
Item | Value |
---|---|
Default Value: | normal? |
Return Value: | A String, representing the space between characters in the text |
CSS Version | CSS1 |
Set the space between characters in a <p> element to 15 pixels:
<!DOCTYPE html> <html> <body> <p id="myP" style="letter-spacing:10px;">This is an example paragraph.</p> <button type="button" onclick="myFunction()">Return letter spacing of p</button> <script> function myFunction() {/*ww w . j av a 2 s.c o m*/ document.getElementById("myP").style.letterSpacing = '15px'; } </script> </body> </html>