Skip to main content
Practice

Text Alignment (text-align), Text Decoration (text-decoration)

Let's learn about the CSS properties text-align and text-decoration, which specify text alignment direction and decoration.


text-align

The text-align property specifies the horizontal alignment of text.


The available values are as follows:

Left Alignment
.left-align {
text-align: left;
}

Right Alignment
.right-align {
text-align: right;
}

Center Alignment
.center-align {
text-align: center;
}

Justified Alignment
.justify-align {
text-align: justify;
}

text-decoration

The text-decoration property is used to add or remove decorations from text.

The available values are as follows:


Underline
.underline {
text-decoration: underline;
}

Overline
.overline {
text-decoration: overline;
}

Line-through
.line-through {
text-decoration: line-through;
}

No Decoration
.no-decoration {
text-decoration: none;
}

Follow the highlighted parts of the code to input them correctly.

Want to learn more?

Join CodeFriends Plus membership or enroll in a course to start your journey.