text-autospace-size CSS property

The text-autospace-size CSS property sets the size of space that the text-autospace property adds between Chinese/Japanese/Korean (CJK) characters and non-CJK letters and numbers.

Syntax

css
/* <number> values */
text-autospace-size: 0.125;
text-autospace-size: 0.25;
text-autospace-size: 0;

/* Global values */
text-autospace: inherit;
text-autospace: initial;
text-autospace: revert;
text-autospace: revert-layer;
text-autospace: unset;

Values

This property is specified as one value:

<number>

Specifies the size of space, as a proportion of the width of a CJK ideograph, represented by the ic unit. The initial value is 0.125. Negative values are invalid.

Description

The text-autospace-size property defines the size of space added between Chinese/Japanese/Korean (CJK) characters and non-CJK letters and numbers by the text-autospace property. It only has an effect when the browser adds spacing between ideographs and non-ideographic letters or numbers, which occurs as long as text-autospace is not set to no-autospace. The value doesn't affecgt the spacing added around punctuation.

The value is a non-negative <number> specifying the the size of the space added relative to the size of an ideograph. For example, the initial value is 0.125, which adds 0.125ic, one-eighth of an ideograph between the ideograph and non-ideographic letters or numbers. Negative values are invalid and 0 adds no space.

Formal definition

Value not found in DB!

Formal syntax

text-autospace-size = 
<number [0,∞]>

Examples

Increasing the spacing

This example compares the default size of space with a larger one. Both paragraphs set text-autospace to normal to add spacing between the Chinese and Latin characters, and the second one doubles it with text-autospace-size.

HTML

We include two paragraphs containing the same text with both ideographic and non-ideographic characters.

html
<p lang="zh">HTML超文本标记语言</p>
<p lang="zh" class="wide">HTML超文本标记语言</p>

CSS

We include basic styles for all paragraphs. We set text-autospace-size to 0.25, twice the default value of 0.125 on the wide paragraph.

css
p {
  margin: 0;
  text-autospace: normal;
  font: 2rem sans-serif;
}
.wide {
  text-autospace-size: 0.25;
}

Result

The space between "HTML" and the Chinese characters is twice as wide in the second paragraph.

Specifications

This feature does not appear to be defined in any specification.

Browser compatibility

See also