Site icon T4Tutorials.com

text formatting CSS

Text-Color

 

How can we format text in CSS?

We can format text by applying different properties on the text.

Example 1:

<html><head>
<style>h1 {
color: green;
}
</style>
</head>
<body><h1>This is heading 1</h1></body></html>

Output:

This is heading 1


Example 2:

<html><head>
<style>h1 {
color: green;text-align: center;
}
</style>

</head>
<body><h1>This is heading 1</h1></body></html>

Output:

This is heading 1

Explanation:

Properties of text-align:


Enlist some of the properties of text CSS?

 Property Description
color Set the color to the text
line-height Sets the height for text line
direction
Sets the text direction
letter-spacing Sets the spacing between alphabets of the words
 word-spacing Sets the spacing between all words

 

Exit mobile version