The text/content displayed in the webpage can be controlled with html and CSS.
This will be useful when css is not supported in some browsers. It is a global attribute applied to any html tag.
<div dir="rtl"> text content from right to left</div>
This has a support in all major browsers.
direction property in CSS used to change the direction of an text element displayed in a page. It has two values rtl and ltl, ltr is default value. rtl is a language read from right to left, ltr is from left to right.
This can also be used to define the page content direction, block text or table columns direction
This will be used to display the page content on web applications in left to right direction for English language based websites and right to left from Arabic based sites.
This article talks about following things
direction attribute values are
if CSS property is declared with ltr all the elements displayed and shown to user from left to right
Here is an example with and without direction property
<h3>CSS Direction Example</h3>
<p class="leftToRight">This is text placed from left to right</p>
<p>Default to left to right without direction property</p>
<p class="rightToLeft">This is text placed from right to left</p>
And the output
###Arabic website direction with CSS direction property
Arabic websites has text direction from right to left on web page.
That means, css direction has to be applied on entire html element, Html tag has dir attribure to specify entire document text direction from right to left
<html dir="rtl" >
<p>this will be arabic text</p>
with css direction property,
This direction in CSS and dir attribute in HTMl has support in all popular browsers.
text direction can be controlled with CSS direction property and dir attribute in HTML.
These are very useful to right to left and vice versa.