margin outer margin
padding inner margin
Four parameters, followed by the upper right and bottom left distance
Example 1
padding:10px 5px 15px 20px;
- Top padding is 10px
- Right inner margin is 5px
- The lower padding is 15px
- Left margin is 20px
Example 2
padding:10px 5px 15px;
- Top padding is 10px
- Right padding and left padding are 5px
- The lower padding is 15px
Example 3
padding:10px 5px;
- Top padding and bottom padding are 10px
- Right padding and left padding are 5px
Example 4
padding:10px;
- All 4 internal margins are 10px
Definition and usage
The Wordspacing property sets the spacing of words in the text.
Grammar:
Object.style.wordspacing=normal|length
Possible values
value |
Description |
Normal |
Default. Defines the standard space between words. |
Length |
Defines a fixed space between words. |
Instance
This example changes the spacing between words:
document.getElementById("p1").style.wordSpacing="10px"; }</script>
Tiy
-
wordspacing-Change the spacing between words
HTML DOM Style Object
CSS Margin padding wordspacing properties