dir attribute
Sets the text direction as related to the lang attribute.
The dir attribute takes effect only on non alphanumeric characters in Latin documents, except for the bdo element.
In that case, the dir attribute has effect on all characters. See the examples for details.
You can use the direction style property instead.
JavaScript page for this attribute: dir. You can find other example(s) there. |
Possible values:
String that sets the direction of the text.
One of the following values:
Default. Left to right. | |||||||
Right to left. |
Default: ltr.
Example HTML code 1:
This example illustrates the use of the dir attribute:
|
||||
<bdo dir="rtl">apple, pear, peach ...</bdo> <br /> <bdo dir="ltr">apple, pear, peach ...</bdo> <br /> |
||||
|
||||
Did you find this example helpful?
|
Example HTML code 2:
This example illustrates the use of the dir attribute:
|
||||
<span dir="rtl">apple, pear, peach ...</span> <br /> <span dir="ltr">apple, pear, peach ...</span> <br /> |
||||
|
||||
Did you find this example helpful?
|
Supported by tags:
a, abbr, acronym, address, applet, area, b, baseFont, bdo, big, blink, blockQuote, body, button, caption, center, cite, code, col, colGroup, dd, del, dfn, dir, div, dl, dt, em, embed, fieldSet, font, form, H1, H2, H3, H4, H5, H6, head, hr, html, i, iframe, img, input:button, input:checkbox, input:file, input:image, input:password, input:radio, input:range, input:reset, input:search, input:submit, input:text, ins, isIndex, kbd, keygen, label, legend, li, link, listing, map, marquee, menu, meta, nobr, noFrames, noScript, object, ol, optGroup, option, p, plainText, pre, q, rt, ruby, s, samp, select, small, span, strike, strong, style, sub, sup, table, tBody, td, textArea, tFoot, th, tHead, title, tr, tt, u, ul, var, xmp
Related pages:
External links:
User Contributed Comments