3CSS Propertiestext Controlling and Text Formatting
3CSS Propertiestext Controlling and Text Formatting
1. letter-spacing
This property sets the space between characters.
<html>
<body>
<p style="letter-spacing: 5px;">letter spacing 5px.</p>
<p style="letter-spacing: -2px;">letter spacing -5px.</p>
</body>
</html>
Output:
2. Word-spacing
This property sets the space between words.
<html>
<body>
<p style="word-spacing: 13px;">word spacing 13px.</p>
<p style="word-spacing: -8px;">word spacing -8px.</p>
</body>
</html>
Output:
3. Line-height
This property is used to specify the space between two lines.
<html>
<head>
<style>
p.small
{
line-height: 0.5;
}
p.big
{
line-height: 1.3;
}
</style>
</head>
<body>
<p> This paragraph has a standard line-height</p>
<p class="big"> This paragraph has bigger line height 1.3.</p>
<p class="small"> This paragraph has smaller line height 0.5</p>
</body>
</html>
Output:
4. Text-decoration
This property is used to set or remove decorations from text.
<html>
<body>
<p style="text-decoration:underline;">
This text is underline.
</p>
<p style="text-decoration:line-through;">
This text is strike through.
</p>
<p style="text-decoration:overline;">
This text will appear overline.
</p>
</body>
</html>
Output:
5. Text-transform
This property is used to specify the text into uppercase, lowercase and
capitalize the first letter of the word.
<html>
<body>
<p style="text-transform:capitalize;">
This text will be capitalized.
</p>
<p style="text-transform:uppercase;">
This text will be in uppercase.
</p>
<p style="text-transform:lowercase;">
This text will be in lowercase.
</p>
</body>
</html>
Output:
This Text Will Be Capitalized.
THIS TEXT WILL BE IN UPPERCASE.
this text will be in lowercase.
6. Text-align
The possible values for text align property are:
left
right
center
justify
7. Text-indent
This property is used to specify the indentation of the first line of the text of
a block level element.
<html>
<body>
<p style="text-indent: 50px;">
This is the first line indented by 50px. <br> This line will remain at
its actual position.
</p>
</body>
</html>
Output:
8. White-space
The white-space property is used to control the flow and formatting of the
text.