Text Alignment

Sometimes we don't want the text to be aligned to the left, but in the center or right. We can use the text-align property for text alignment, which can have the following values: left, center, right.

For example:

h1 {
	text-align: center;
}

This will align the first-level headings to the center.

Instructions

Align the second-level headings (h2) to the center.

Start programming for free

By signing up, you agree to the Terms of Service and Privacy Policy.

Or sign up with:

6/9

Text Alignment | Start Coder