writingMode style property
Specifies or returns the intrinsic writing direction of the element's content.
In Western languages, the common text order is left-to-right, top-to-bottom, but some Asian writings need to render text top-to-bottom, right-to-left.
With this property, you can switch between these modes.
Syntax:
You can find the related objects in the Supported by objects section below.
This property is read/write.
CSS page for this property: writing-mode |
Possible values:
The type of this property is string.
One of the following values:
Content flows from bottom to top, and right to left. | |||||||
Default. Content flows from left to right, and top to bottom. | |||||||
Default. Content flows from right to left, and top to bottom. | |||||||
Content flows from top to bottom, and right to left. |
Default: lr-tb.
Example HTML code 1:
This example illustrates the use of the writing-mode property:
|
||||
<head> <style> .example { writing-mode: tb-rl; } </style> </head> <body> <a class="example"> writing mode </a> </body> |
||||
|
||||
Did you find this example helpful?
|
Example HTML code 2:
This example illustrates the use of the writingMode property in JavaScript:
|
||||
<head> <script type="text/javascript"> function ChangeWritingMode (value) { var anchor = document.getElementById ("myAnchor"); if ('writingMode' in anchor.style) { anchor.style.writingMode = value; } else { alert ("Your browser doesn't support this example!"); } } </script> </head> <body> <a id="myAnchor"> writing mode </a> <br /> <button onclick="ChangeWritingMode ('lr-tb');">lr-tb</button> <button onclick="ChangeWritingMode ('tb-rl');">tb-rl</button> </body> |
||||
|
||||
Did you find this example helpful?
|
Supported by objects:
CSSStyleDeclaration, htmlElement.currentStyle, htmlElement.runtimeStyle, htmlElement.style
HTML elements:
a, abbr, acronym, address, b, basefont, bdo, big, blockquote, body, button, caption, center, cite, code, dd, del, dfn, dir, div, dl, dt, em, fieldset, font, form, h1, h2, h3, h4, h5, h6, html, i, input:button, input:file, input:password, input:reset, input:submit, input:text, ins, isindex, kbd, label, legend, li, listing, marquee, menu, nobr, ol, p, pre, q, rt, ruby, s, samp, select, small, span, strike, strong, sub, sup, table, tbody, td, textarea, tfoot, th, thead, tt, u, ul, var, xmp
Related pages:
External links:
User Contributed Comments