<?xml version="1.0" encoding="utf-8"?>

CSS text-align property with the right value

CSS text-align property with the right value Bad Practice
CSS text-align property with the right value Best Practice

The right-aligned text sticks to the right edge of a page or container. For that matter, we use the text-align property with the right value. The most basic syntax goes like this:

{

text-align: right;

}

Right alignment is one of the least common types as it takes too much effort for users to scan and consume.

In turn, it can be helpful for headlines or short messages for creating a unique or "offbeat" look and feel. Indeed, in languages with right-to-left scripts, like Arabic, Hebrew or Urdu, flush right alignment is the first choice to maintain readability.

Improve your UX & Product skills with interactive courses that actually work