|
HTML DOM writingMode Property
Definition and Usage
The writingMode property sets or returns the direction and flow of the text.
Syntax
|
Object.style.writingMode=lr-tb|rl-tb|tb-rl|bt-rl
|
Possible Values
| Value |
Description |
| lr-tb |
Default. Content is displayed horizontally from left to
right, top to bottom. This layout is used by most writing systems |
| rl-tb |
Content is displayed horizontally from right to left, top to bottom.
This layout is used with right to left scripts like Arabic, Hebrew,
Thaana, and Syriac |
| tb-rl |
Content is displayed vertically from top to bottom, right to left. The
next vertical line is positioned to the left of the previous line. This
layout is used in East Asian typography |
| bt-rl |
Content is displayed from bottom to top, right to left. The next
vertical line is positioned to the left of the previous line. This
layout is used for right to left script blocks used in vertical East
Asian typography |
Example
The following example changes the direction and flow of the text:
<html>
<head>
<script type="text/javascript">
function changeWritingMode()
{
document.getElementById("p1").style.writingMode="tb-rl";
}
</script>
</head>
<body>
<p id="p1">This is an example paragraph.</p>
<form>
<input type="button" onclick="changeWritingMode()"
value="Change writing mode" />
</form>
</body>
</html>
|
|
|