Course Content

  • Lecture-26_justify
  • Lecture-26_text-align
  • Lecture-26_text-decoration

Course Content


The text-align attribute determines how text in an element is aligned horizontally.

In CSS, the text-align property is used to specify the horizontal alignment of text in an element, i.e., it is used to align content horizontally within a block element or table-cell box. It's used to inherit a property from the parent element's property value to an element.

In CSS, utilise the text-align property and set the value to "centre" to centre text. Let's begin with a simple example. Let's say you have a text-only web page that you want to focus. To target every element on the page, you may use the CSS universal selector (*) or the type selector body.

The default setting is left. The content is aligned to the left. right — The content is aligned to the right. Between the left and right margins, the content is centred.

When you justify text, you add space between words so that the two margins are aligned on both sides of each line. The paragraph's final line is oriented to the left.

Recommended Courses

Share With Friend

Have a friend to whom you would want to share this course?

Download LearnVern App

App Preview Image
App QR Code Image
Code Scan or Download the app
Google Play Store
Apple App Store
598K+ Downloads
App Download Section Circle 1
4.57 Avg. Ratings
App Download Section Circle 2
15K+ Reviews
App Download Section Circle 3
  • Learn anywhere on the go
  • Get regular updates about your enrolled or new courses
  • Share content with your friends
  • Evaluate your progress through practice tests
  • No internet connection needed
  • Enroll for the webinar and join at the time of the webinar from anywhere