CSS Text

Unique beauty

CSS Text:

The CSS text formatting properties are used to format text, style the text and perform different types of manipulations like word spacing, alignment, justification, and text transformation.

Syntax:

The Syntax to write this property:


Selector {

    property-name : /*value*/

}

CSS Text Formatting Properties: 

These are the following text formatting properties.

Text Color: 

➡This property is used to set the color of the text and the color can be set by using a color name like “red”, hex value “#ff0000”, or by its RGB value “rgb(255,0,0)”;

Text-align:

 This property in CSS is used to specify the horizontal alignment of text in an element inside a block element or table-cell box.

 Text-align-last:

 It is used to set the last line of the paragraph just before the line break. It sets the alignment of all the last lines occurring in the element in which the text-align-last property is applied.

Text-decoration:

 text-align-last property is used to “decorate ” the content of the text.

Text-decoration-color: 

It is used to set the color of the decorations (overlines, underlines, and line-throughs) over the text.

Text-decoration-line: 

It is used to set the various kinds of text decorations. this may include many values such as underline, overline, line-through, etc.

Text-decoration-style: 

This property is used to set the text-decoration of the element. It is the combination of the text-decoration-line and text-decoration-color properties.

Text-indent:

 It is used to indent the first line of the paragraph and the size can be in px, cm, pt.

Text-justify:

 This property is used to set the text-align to justify. It spreads the words into complete lines.

Text-overflow: 

This property of text formatting specify that some text has overflown and is hidden from the view.

Text-transform: 

It is used to control the capitalization of the text.

Text-shadow:

 it is used to add shadow to the text.

Letter-spacing: 

This property is used to specify the space between the characters of the text.

Line-height:

 It is used to set the space between the lines.

Direction: 

This property is used to set the direction of the text.

Word-spacing:

 It is used to specify the space between the words of the line.

Example: 

This example illustrates the use of text color property.

<!DOCTYPE html>

<html>

 

<head>

    <style>

        h1 {

            color: orange;

        }

           h2 {

            color: sky blue;

        }

    </style>

</head>

 <body>

    <h1>

        UNIQUE BEAUTY 

    </h1>

    <h2>

       BEAUTY OF SECRET 

    </

h2>

</body>

 </html>

Output:

UNIQUE BEAUTY 

BEAUTY OF SECRET 

Our website uses cookies to enhance your experience. Learn More
Accept !

GocourseAI

close
send