Text Alignment + Sizing

Learn how to manipulate a web page's text in detail.

Text alignment

By default, text elements are aligned to the left of their container. Use the text-align property to change the alignment of text within an element. text-align has four different values:

  • center: center the text
  • left: align the text to the left of its container
  • right: align the text to the right of its container
  • justify: the text will spread out to fill out the full width of its container

Create a free account to access the full course.

By signing up, you agree to Educative's Terms of Service and Privacy Policy