Using negative values in letter spacing - Javascript CSS Style Property

Javascript examples for CSS Style Property:letterSpacing

Description

Using negative values in letter spacing

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<p id="myP">This is an example paragraph.</p>

<button type="button" onclick="myFunction()">Set letter spacing</button>

<script>
function myFunction() {//ww  w .j  a  v a2s .c  om
    document.getElementById("myP").style.letterSpacing = "-2px";
}
</script>

</body>
</html>

Related Tutorials