Skip to main content
๐ŸŽจ CSS Basics

Text alignment ๐ŸŽฏ

text-align positions text inside its box: left, right, center, or justify.

.box { text-align: center; }

Notice the selector here is .box with a dot in front. A dot means "class" โ€” it matches any element with class="box". So .box reads as "every element labeled box."

Your task

Center the text inside .box. Drag the blocks in, or type the line yourself.

โšก 20 XP

Hints

index.htmliframe
Loading editorโ€ฆ
Preview
Run your code to see test results.