In Chinese, Japanese, Korean, and Mongolian vertically-set text it is normal for list counters to sit upright above the start of the list.
Until recently this was problematic, because browsers would only show the numbers lying on their side. This article describes how to make them stand upright as shown in the picture above.
We'll look at two alternative approaches, one of which works across all major browser engines, and another which doesn't currently work with WebKit browsers.
Customised counter-styles are now supported by all major browser engines. This therefore provides an interoperable solution.
First, you need to create an @counter-style
declaration in your CSS. We suggest two alternatives below, but as these are customisable you can also make up your own.
Option 1. Numbers followed by dots.
Option 2. Circled numbers.
These counter style definitions are taken from Ready-made Counter Styles, where you can find several alternative styles that may be of interest.
Note that these counter styles are of the 'fixed' type. This means that they only support lists containing up to 20 or 50 items, respectively. This is probably not problematic for most lists in vertical text.
Once you have added these definitions to your CSS, then tie them to your list using CSS code such as the following. You can, of course, add a class name to your element selector, if you want to apply the style to just certain lists.
Output in your browser:
An alternative approach would be to use ordinary markup, but style the counter so that it is upright. This would enable you to have lists longer than those described above, but the positioning of the counters relative to the list item text is currently not so accurate.
For this approach we use the following CSS.
Here's the result in your browser. As mentioned before, it mostly works in Blink and Gecko browsers, though the horizontal position is not quite right in Blink. But it doesn't work in Safari, so it's not a fully interoperable solution (at least not yet).
Output in your browser:
Both types of list described above can benefit from additional styling. For example, using the following CSS we can make the markers in the example just above slightly bigger, and coloured, and we can create a slightly larger gap between the counter and the list text.
Output in your browser:
The CSS ::marker
pseudo-element allows you to apply the following adjustments:
white-space
propertycolor
text-combine-upright
, unicode-bidi
, and direction
content
propertyAuthoring web pages
Language Enablement