Text-orientation - Property CSS
Summary of characteristics of the text-orientation
property
mixed
| sideways
| upright
mixed
Not animable
: the text-orientation
property cannot be animated.Syntax diagram of text-orientation
.
text-orientation
propertyThe links on the diagram give access to a more detailed syntax
Description of the text-orientation
property.
text-orientation
defines the orientation of characters in the case of vertically written text, i.e. blocks whose writing-mode
property
to the vertical-lr
or vertical-rl
value.
text-orientation
has no effect on elements with horizontal write directions.
See writing modes for detailed explanations of writing modes for different languages.
Also see the text-combine-upright
property.
Values for text-orientation
.
- text-orientation: mixed;
The orientation of the characters depends on the language of the element:
If the characters correspond to a language that is normally written horizontally, the characters will be rotated 90° clockwise, so that, by leaning his head to the right, the reader regains a normal handwriting.
If, on the other hand, the characters correspond to a language that is normally written vertically, the characters are displayed in their usual orientation.
Vertical text
竖排文本 - text-orientation: upright;
The characters are displayed in their usual orientation. This value makes it easier to read characters for languages that are normally written in the horizontal direction, but which, for reasons of layout, one wishes to display vertically.
Vertical text
竖排文本 - text-orientation: sideways;
The characters are displayed rotated 90° clockwise. Whatever the language, the composition of the text corresponds to a horizontal writing that has undergone a 90° rotation.
Vertical text
竖排文本 - text-orientation: sideways-right; ✗
This value is no longer standardized. It is equivalent to
sideways
. It is therefore recommended to use the latter instead.
Global values
(common to all properties):
text-orientation: initial (mixed
)
text-orientation: inherit
text-orientation: revert
text-orientation: revertLayer
text-orientation: unset
See the following pages for more details: initial
, inherit
, revert
, revert-layer
, unset
.
Animation of the text-orientation
property.
The text-orientation
property cannot be animated.
Manipulate the text-orientation
property with Javascript.
Changed the value of text-orientation
.
In Javascript, here's how to change the value of text-orientation
.
We see that Javascript offers a syntax with the typical CSS notation, kebab-case
, and another syntax with the notation in camel-case
.

let el = document.getElementById('id');
el.style['text-orientation'] = 'upright';
// or
let el = document.getElementById('id');
el.style.textOrientation = 'upright';
Retrieving the value of text-orientation
.
For this code to work, the property must have been assigned directly to the element itself via its style
attribute,
and not by going through a CSS selector.

let el = document.getElementById('id');
let value = el.style['text-orientation'];
// or
let el = document.getElementById('id');
let value = el.style.textOrientation;
Retrieving the calculated value of text-orientation
.
The calculated value is the value resulting from the evaluation of the cascade of inheritances. Otherwise, the calculated value is the initial value
(mixed
in the case of text-orientation
.

let el = document.getElementById('id');
let value = window.getComputedStyle(el).getPropertyValue('text-orientation');
Changing the value of text-orientation
with JQuery.

$('#id').css('text-orientation', 'upright');
// or
$('#id').css('textOrientation', 'upright');
Retrieving the Calculated Value of text-orientation
with JQuery.

let value = $('#id').css('text-orientation');
Test it yourself.
The buttons below apply the entered value to the text-orientation
property and then display either the value as applied,
or the calculated value, but in the case of text-orientation
the two values will be identical.
Interactive example.
As announced earlier, the simulator has no effect on languages with horizontal writing, i.e. latin languages and the Arabic language.
vertically
垂直书写的文本
Browser compatibility.
The text-orientation
property is properly supported by current browsers. The sideways
value that has long been a problem,
is now well recognized as well.
text-orientation
property that defines the orientation of characters.value sideways
for the text-orientation
property.text-orientation
property
sideways
value
Browsers on computers :
Mobile browsers :
Outdated or marginal browsers :

Internet Explorer

KaiOS Browser

Opéra Mobile

Chrome

Edge

Opéra

Safari

Safari sur IOS

Androïd Brower

Chrome pour Androïd

Firefox pour Androïd

Samsung Internet

Firefox

Baidu Browser

QQ Browser

UC Browser pour Androïd

Opéra mini
text-orientation
property historic.
-
CSS Writing Modes Level 3
First definition of thetext-orientation
property.December 02, 2010Working Draft.March 20, 2014Candidate Recommendation.October 24, 2019Proposed for recommendation.December 10, 2019Recommendation . -
CSS Writing Modes Level 4
No change to thetext-orientation
property.December 07, 2017Working Draft.May 24, 2018Candidate Recommendation.
See also, concerning the modes of writing.
The specification for writing modes is called CSS Writing Modes. It includes everything related to bidirectional writing, and
fine management of vertical writing (CJK).
The text-orientation
property is described in this module, along with the following properties:
Properties:




