CORE ATTRIBUTE:  dir

dir="direction"
Available in versions: 4.0
HTML 4.0 tag compatibility: All tags except applet, base, basefront, bdo, br, frame, frameset, iframe, param, script
 
The dir core attribute is used to declare the direction that the text should run, either left to right (default) or right to left. This allows the internationalization of HTML since several important foreign languages read right to left, such as Chinese and Hebrew.
 
Also, see the lang core attribute that defines the language being used. However, note that using lang by itself does not specify language direction.
 
If used as an attribute of the HTML tag, it will apply to the entire document. When used with other tags, it only applies to the text under the influence of that tag. For example, when used with the table tag, the first column of the table will start on the right side and each additional column will be farther to the left.
 
This attribute should not be used to simply reverse a string. That is best done by using the VBScript StrReverse( ) function.
 
You may only use the following values:
 
dir="ltr"
The ltr value, which directs the text to flow from left to right, is the default.
 
dir="rtl"
The rtl value directs the text to flow from right to left.
 
Note that .html texts that contain foreign languages that use special characters will have to be saved as a Unicode file, rather than as an ANSI file, in order for the characters to be properly displayed. Please be aware that some browsers may not be capable of correctly displaying a Unicode file.
 
Code:
<html dir="rtl" lang="he">
<body>
 
place text of right to left language here
 
</body>
</html>

 
The output example is a Unicode file and may not properly display in some browsers.
 
Output:
Click to see output in a separate window


Copyright 1999-2001 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information