Using negative values for word spacing - Javascript CSS Style Property

Javascript examples for CSS Style Property:wordSpacing

Description

Using negative values for word 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 word spacing</button>

<script>
function myFunction() {// ww w .java2s . c om
    document.getElementById("myP").style.wordSpacing = "-3px";
}
</script>

</body>
</html>

Related Tutorials