CSS Direction Property

In this chapter you will learn:
About direction property
Direction values
Examples of this property

As its name suggests direction so you can easily understand that this property is used to specify the direction of the element. You can use this property to display element in a particular direction such as ltr and rtl. Suppose that you want to write Arabic language then you can use direction property with value rtl.

Syntax:-
  1. Selector { direction:ltr;  }
  2. Selector { direction:rtl;  }
Direction values:-
Ltr:-left to write direction
Rtl:-Right to left direction


Examples of this property:-
Example 1. direction:ltr;
<html>
<head>
<style type="text/css">
div.a
 {
direction:ltr;
}
</style>
</head>
<body>
<div class="a">
This is the example of direction property whose value is ltr.
</div>
</body>
</html>

Output:- example 1 of direction property Example 2. direction:rtl;
<html>
<head>
<style type="text/css">
div.a
 {
direction :rtl;
}
</style>
</head>
<body>
<div class="a">
This is the example of direction property whose value is rtl.
</div>
</body>
</html>

Output:- example 2 of direction property

Summary

In this chapter, you have learned about direction property and its uses with an example so now try yourself and click on Next button to continue-

More Articles

 

Share your thought