Open In App
Related Articles

CSS direction Property

Improve Article
Save Article
Like Article

The direction property specifies the direction of the text/writing within any block element. It can have two values rtl(right to left) or ltr( left to right)


element_selector {
    direction: rtl|ltr|initial|inherit;

Default Value: ltr 

Property values:  

  • rtl: Specifies the direction as the right to left.
  • ltr(default): Specifies the direction as left to right which is also the default direction.
  • initial: Sets the property to its default value.
  • inherit: Inherits the property from the parent element.

Example: In this example, we are using the above-explained property.


<!DOCTYPE html>
        CSS | direction Property
        html {
            color: green;
        .rtl {
            direction: rtl;
        .ltr {
            direction: ltr;
    <p>This text goes from left to right. This is default.</p>
    <p class="ltr">This text goes from left to right.</p>
    <p class="rtl">This text goes from right to left.</p>


Supported Browsers: The browsers supported by direction property are listed below: 

  • Google Chrome 2.0
  • Edge 12.0
  • Internet Explorer 5.5
  • Firefox 1.0
  • Opera 9.2
  • Apple Safari 1.0
Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out - check it out now!

Last Updated : 13 Jun, 2023
Like Article
Save Article
Similar Reads
Related Tutorials