Title: CSS Text Module Level 4 Shortname: css-text Level: 4 Status: ED Work Status: Exploring Group: csswg ED: https://drafts.csswg.org/css-text-4/ TR: https://www.w3.org/TR/css-text-4/ Previous Version: https://www.w3.org/TR/2024/WD-css-text-4-20240529/ Editor: Elika J. Etemad / fantasai, Apple, http://fantasai.inkedblade.net/contact, w3cid 35400 Editor: Koji Ishii, Invited Expert, kojiishi@gluesoft.co.jp, w3cid 45369 Editor: Alan Stearns, Adobe Systems, stearns@adobe.com, w3cid 46659 Editor: Florian Rivoal, Invited Expert, https://florian.rivoal.net, w3cid 43241 Abstract: This CSS module defines properties for text manipulation and specifies their processing model. It covers line breaking, justification and alignment, white space handling, and text transformation. Ignored Vars: letter-spacing WPT Path Prefix: /css/css-text/
spec:css-display-3; type:property; text:display spec:css-fonts-4; type:property; text:font-feature-settings spec:selectors-4; type:selector; text::lang() spec:css2; type:dfn; text:document language spec:css-ruby-1; type:dfn; text:ruby spec:selectors-4; type:dfn; text:selector
{ "L2-22-080R": { "authors": [ "Norbert Lindenberg", "Elika Etemad", "Vaishnavi Murthy Yerkadithaya" ], "href": "https://www.unicode.org/L2/L2022/22080r-line-break-ortho-bnd.pdf", "title": "Line breaking at orthographic syllable boundaries", "status": "Proposal", "publisher": "Unicode Consortium" } }
Authors should accurately language-tag their content
for the best typographic behavior.
Many typographic effects vary by linguistic context.
Language and writing system conventions can affect
line breaking, hyphenation, justification, glyph selection,
and many other typographic effects.
In CSS, language-specific typographic tailorings
are only applied when the [=content language=] is known (declared).
Therefore,
higher quality typography requires authors to communicate to the UA
the correct linguistic context of the text in the document.
The content language of an element is the (human) language
the element is declared to be in, according to the rules of the
[=document language=].
Note that it is possible for the [=content language=] of an element
to be unknown--
e.g. untagged content,
or content in a [=document language=] that does not have a language-tagging facility,
is considered to have an unknown [=content language=].
Note: Authors can declare the [=content language=]
using the global lang
attribute in HTML
or the universal xml:lang
attribute in XML.
See the rules for determining the content language of an HTML element
in HTML,
and the [[XML#sec-lang-tag|rules for determining the content language of an XML element]] in XML 1.0.
[[HTML]]
[[XML10]]
The [=content language=] an element is declared to be in
also identifies the specific written form of that language used in that element,
known as the content writing system.
Depending on the [=document language=]’s facilities for identifying the [=content language=],
this information can be explicit or implied.
See the normative [[#script-tagging]].
Note: Some languages have more than one writing system tradition;
in other cases a language can be transliterated into a foreign writing system.
Authors should [[#script-tagging|subtag]] such cases
so that the UA can adapt appropriately.
ko
) can be written in
Hangul (-Hang
),
Hanja (-Hani
),
or a combination (-Kore
).
Historical documents written solely in Hanja
do not use word spaces and
are formatted more like modern Chinese than modern Korean.
In other words, for typographic purposes ko-Hani
behaves more like zh-Hant
than ko
(ko-Kore
).
As another example Japanese (ja
) is typically written
in a combination (-Japn
) of Hiragana (-Hira
),
Katakana (-Kana
), and Kanji (-Hani
).
However, it can also be “romanized” into Latin (-Latn
)
for special purposes like language-learning textbooks,
in which case it should be formatted more like English than Japanese.
As a third example contemporary Mongolian is written in two scripts:
Cyrillic (-Cyrl
, officially used in Mongolia)
and Mongolian (-Mong
, more common in Inner Mongolia, part of China).
These have very different formatting requirements,
with Cyrillic behaving similar to Latin and Greek,
and Mongolian deriving from both Arabic and Chinese writing conventions.
Name: text-transform Value: none | [capitalize | uppercase | lowercase ] || full-width || full-size-kana | math-auto Initial: none Applies to: text Inherited: yes Canonical order: n/a Computed value: specified keyword Animation type: discrete
abbr:lang(ja) { text-transform: full-width; }
section > p:first-of-type::first-line { text-transform: uppercase; }This effect cannot be written into the source document because the position of the line break depends on layout. But also, the capitalization is not reflecting a semantic distinction and is not intended to affect the paragraph’s reading; therefore it belongs in the presentation layer.
rt { font-size: 50%; text-transform: full-size-kana; } :is(h1, h2, h3, h4) rt { text-transform: none; /* unset for large text*/ }Note that while this makes such letters easier to see at small type sizes, the transformation distorts the text: the reader needs to mentally substitute [=small kana=] in the appropriate places-- not unlike reading a Latin inscription where all “U”s look like “V”s. For example, if ''text-transform: full-size-kana'' were applied to the following source, the annotation would read “じゆう” (jiyū), which means “liberty”, instead of “じゅう” (jū), which means “ten”, the correct reading and meaning for the annotated “十”.
<wide>
or the <narrow>
tag
in their Decomposition_Mapping
in Unicode Standard Annex #44: Unicode Character Database.
[[!UAX44]]
For the <narrow>
tag,
the mapping is from the code point to the decomposition
(minus <narrow>
tag),
and for the <wide>
tag,
the mapping is from the decomposition
(minus the <wide>
tag)
back to the original code point.
Name: word-space-transform Value: none | [ space | ideographic-space ] && auto-phrase? Initial: none Applies to: text Inherited: yes Percentages: N/A Computed value: as specified Animation type: discrete
<p>むかしむかし、<wbr>あるところに、<wbr>おじいさんと<wbr>おばあさんが<wbr>すんでいました。
むかしむかし、あるところに、おじいさんとおばあさんがすんでいました。
p {
word-space-transform: ideographic-space;
}
むかしむかし、 あるところに、 おじいさんと おばあさんが すんでいました。
p {
word-break: keep-all;
word-space-transform: ideographic-space;
}
むかしむかし、 p
when they also delimit a phrase.
<p>らいしゅう<wbr>の<wbr>じゅぎょう<wbr>に<wbr class=p
>たいこ<wbr>と<wbr>ばち<wbr>を<wbr class=p
>もって<wbr>きて<wbr>ください。
Using this, it is possible not only to enable the rather common phrase-based spacing,
but also word-by-word spacing
that is likely to be preferred
by people with dyslexia to reduce ambiguities,
or other variants
such as a combination of phrase-based spacing and of word-based wrapping.
p wbr.p {
word-space-transform: ideographic-space;
}
らいしゅう
p wbr {
word-space-transform: ideographic-space;
}
らいしゅう
p {
word-break: keep-all;
}
p wbr.p {
word-space-transform: ideographic-space;
}
らいしゅう
p {
word-break: keep-all;
}
p wbr {
word-space-transform: ideographic-space;
}
らいしゅう Name: white-space Value: normal | pre | pre-wrap | pre-line | <<'white-space-collapse'>> || <<'text-wrap-mode'>> || <<'white-space-trim'>> Initial: normal Applies to: text Inherited: see individual properties Canonical order: n/a Computed value: specified keyword Animation type: discrete
'white-space' | 'white-space-collapse' | 'text-wrap-mode' | 'white-space-trim' |
---|---|---|---|
normal | ''white-space-collapse/collapse'' | ''text-wrap-mode/wrap'' | ''white-space-trim/none'' |
pre | ''white-space-collapse/preserve'' | ''text-wrap-mode/nowrap'' | ''white-space-trim/none'' |
pre-wrap | ''white-space-collapse/preserve'' | ''text-wrap-mode/wrap'' | ''white-space-trim/none'' |
pre-line | ''white-space-collapse/preserve-breaks'' | ''text-wrap-mode/wrap'' | ''white-space-trim/none'' |
New Lines | Spaces and Tabs | Text Wrapping | End-of-line [=spaces=] | End-of-line [=other space separators=] | |
---|---|---|---|---|---|
''white-space/normal'' | Collapse | Collapse | Wrap | Remove | Hang |
''pre'' | Preserve | Preserve | No wrap | Preserve | No wrap |
''white-space/nowrap'' | Collapse | Collapse | No wrap | Remove | Hang |
''pre-wrap'' | Preserve | Preserve | Wrap | Hang | Hang |
''break-spaces'' | Preserve | Preserve | Wrap | Wrap | Wrap |
''pre-line'' | Preserve | Collapse | Wrap | Remove | Hang |
RECORD-START
and RECORD-END
tokens.
For CSS processing,
each document language–defined “segment break” or “newline sequence”--
or if none are defined, each line feed (U+000A)--
in the text is treated as a segment break,
which is then interpreted for rendering as specified by the 'white-space' property.
In the case of HTML,
[[html#newlines|newlines]] are [=normalize newlines|normalized=] to line feed characters (U+000A)
for representation in the DOM,
so when an HTML document is represented as a DOM tree
each line feed (U+000A)
is treated as a [=segment break=].
[[HTML]]
[[DOM]]
Note: In most common CSS implementations,
HTML does not get styled directly.
Instead, it is processed into a DOM tree,
which is then styled.
Unlike HTML,
the DOM does not give any particular meaning to carriage returns (U+000D),
so they are not treated as [=segment breaks=].
If carriage returns (U+000D) are inserted into the DOM
by means other than HTML parsing,
they then get treated as defined below.
Cc
)--
other than tabs (U+0009),
line feeds (U+000A),
carriage returns (U+000D)
and sequences that form a [=segment break=]--
must be rendered as a visible glyph
which the UA must synthesize if the glyphs found in the font are not visible,
and must be otherwise treated as any other character
of the Other Symbols (So
) [=general category=] and Common [=Unicode Script|script=].
The UA may use a glyph provided by a font specifically for the control character,
substitute the glyphs provided for the corresponding symbol in the Control Pictures block,
generate a visual representation of its code point value,
or use some other method to provide an appropriate visible glyph.
As required by Unicode,
unsupported Default_ignorable
characters
must be ignored for text rendering.
[[!UNICODE]]

).
Name: white-space-collapse Value: collapse | discard | preserve | preserve-breaks | preserve-spaces | break-spaces Initial: collapse Applies to: text Inherited: yes Percentages: n/a Computed value: specified keyword Animation type: discrete
xml:space="preserve"
in SVG.)
@namespace m "http://www.w3.org/1998/Math/MathML"; m|* { white-space-collapse: discard; } m|mi, m|mn, m|mo, m|ms, m|mtext { white-space-trim: discard-inner; }
Name: white-space-trim Value: none | discard-before || discard-after || discard-inner Initial: none Applies to: [=inline boxes=] and [=block containers=] Inherited: no Percentages: n/a Computed value: specified keyword(s) Animation type: discreteThis property allows authors to specify trimming behavior at the beginning and end of a box. Values have the following meanings:
The following style rules render DT elements as a comma-separated list, even if they are coded on separate lines of the source document:
dt { display: inline; } dt + dt:before { content: ", "; white-space-trim: discard-before; }
The following style rule removes source-formatting white space adjacent to the opening/closing tags of a preformatted block, but not any indentation or interleaved white space applied to the actual contents of the element:
pre { white-space: pre; white-space-trim: discard-inner; }This results in the following two source-code snippets:
some preformatted text
some preformatted text
some preformatted textIf instead we apply it to an inline element:
span { white-space: normal; white-space-trim: discard-inner; }
start[some inline text]end
Bidi_Control
property [[!UAX9]])
as if they were not there:
<ltr>A <rtl> B </rtl> C</ltr>
where the <ltr>
element represents a left-to-right embedding
and the <rtl>
element represents a right-to-left embedding.
If the 'white-space' property is set to ''white-space/normal'',
the white-space processing model will result in the following:
A BCNote that there will be two [=spaces=] between A and B, and none between B and C. This is best avoided by putting [=spaces=] outside the element instead of just inside the opening and closing tags and, where practical, by relying on implicit bidirectionality instead of explicit embedding levels.
p {
white-space: pre-wrap;
width: 5ch;
border: solid 1px;
font-family: monospace;
text-align: center;
}
0
p {
white-space: pre-wrap;
width: 3ch;
border: solid 1px;
font-family: monospace;
}
0 0 0 0
p { text-align: right; }
was added,
the result would be as follows:
p {
white-space: pre-wrap;
width: 3ch;
border: solid 1px;
font-family: monospace;
}
0 0 0 0
0
because characters that [=conditionally hang=] are not considered
when measuring the line’s contents for fit.
Here is an English paragraph that is broken into multiple lines in the source code so that it can be more easily read and edited in a text editor.Here is an English paragraph that is broken into multiple lines in the source code so that it can be more easily read and edited in a text editor.
這個段落是那麼長,
在一行寫不行。最好
用三行寫。
這個段落是那麼長,在一行寫不行。最好用三行寫。
Name: tab-size Value: <> | < > Initial: 8 Applies to: text Inherited: yes Computed value: the specified number or absolute length Animation type: by computed value type Canonical order: n/a
Name: text-wrap-mode Value: wrap | nowrap Initial: wrap Applies to: text Inherited: yes Percentages: n/a Computed value: specified keyword Animation type: discrete
BK
, CR
, LF
, and NL
line breaking class,
must be treated as [=forced line breaks=].
[[!UAX14]]
Name: wrap-inside Value: auto | avoid Initial: auto Applies to: inline boxes Inherited: no Percentages: n/a Computed value: specified keyword Animation type: discrete
footer { wrap-inside: avoid; } venue { wrap-inside: avoid; } date { wrap-inside: avoid; } place { wrap-inside: avoid; }and the following markup:
<footer> <venue>27th Internationalization and Unicode Conference</venue> • <date>April 7, 2005</date> • <place>Berlin, Germany</place> </footer>In a narrow window the footer could be broken as
27th Internationalization and Unicode Conference • April 7, 2005 • Berlin, Germanyor in a narrower window as
27th Internationalization and Unicode Conference • April 7, 2005 • Berlin, Germanybut not as
27th Internationalization and Unicode Conference • April 7, 2005 • Berlin, Germany
Name: wrap-before, wrap-after Value: auto | avoid | avoid-line | avoid-flex | line | flex Initial: auto Applies to: inline-level boxes and flex items Inherited: no Percentages: n/a Computed value: specified keyword Animation type: discreteThese properties specify modifications to break opportunities in line breaking (and flex line breaking [[CSS3-FLEXBOX]]). Possible values:
Name: text-wrap-style Value: auto | balance | stable | pretty | avoid-orphans Initial: auto Applies to: [=block containers=] hat establish an [=inline formatting context=] Inherited: yes Percentages: n/a Computed value: specified keyword Animation type: discreteIssue: The CSSWG is looking for a better name for ''avoid-orphans''.
ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα
πολλὰ πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον
ἔπερσεν.
Applying ''text-wrap-style: avoid-orphans'' could yield something like this instead,
which is arguably more pleasing:
ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς
μάλα πολλὰ πλάγχθη, ἐπεὶ Τροίης ἱερὸν
πτολίεθρον ἔπερσεν.
Circumnavigating the Mississippi riverAn attempt to make the last line less short by wrapping the previous line earlier would result in the following:
Circumnavigating the Mississippi riverWhile the last line would indeed no longer be short, the penultimate line would be unsightly. In such cases, user agents are expected to prefer the first rendering despite ''text-wrap-style: avoid-orphans'' being set.
Name: text-wrap Value: <<'text-wrap-mode'>> || <<'text-wrap-style'>> Initial: wrap Applies to: see individual properties Inherited: see individual properties Percentages: see individual properties Computed value: see individual properties Animation type: see individual properties
CM
,
and SG
,
WJ
,
ZW
,
GL
,
and ZWJ
Unicode line breaking classes
must be honored.
[[!UAX14]]
Name: word-break Value: normal | break-all | keep-all | manual | auto-phrase | break-word Initial: normal Applies to: text Inherited: yes Canonical order: n/a Computed value: specified keyword Animation type: discrete
NU
,
AL
,
AI
,
or ID
Unicode line breaking classes
as [=typographic letter units=] for this purpose (only).
[[!UAX14]]
각 줄의 마지막에 한글이 올 때 줄 나눔 기 준을 “글자” 또는 “어절” 단위로 한다.
각 줄의 마지막에 한글이 올 때 줄 나눔 기준을 “글자” 또는 “어절” 단위로 한다.Ethiopic similarly has two styles of line-breaking, either only breaking at [=word separators=] (''word-break: normal''), or also allowing breaks between letters within a word (''word-break: break-all'').
ተወልዱ፡ኵሉ፡ሰብእ፡ግዑዛን፡ወዕሩያን፡ በማዕረግ፡ወብሕግ።ቦሙ፡ኅሊና፡ወዐቅል፡ ወይትጌበሩ፡አሐዱ፡ምስለ፡አሀዱ፡ በመንፈሰ፡እኍና።
ተወልዱ፡ኵሉ፡ሰብእ፡ግዑዛን፡ወዕሩያን፡በማ ዕረግ፡ወብሕግ።ቦሙ፡ኅሊና፡ወዐቅል፡ወይትጌ በሩ፡አሐዱ፡ምስለ፡አሀዱ፡በመንፈሰ፡እኍና።
NU
(“numeric”),
AL
(“alphabetic”),
or SA
(“Southeast Asian”)
line breaking classes [[!UAX14]])
are instead treated as ID
(“ideographic characters”)
for the purpose of line-breaking.
Hyphenation is not applied.
NU
,
AL
,
AI
,
or ID
Unicode line breaking classes [[!UAX14]])
are suppressed,
i.e. breaks are prohibited between pairs of such characters
(regardless of 'line-break' settings other than ''line-break/anywhere'')
except where opportunities exist due to [[#lexical-breaking]].
Otherwise this option is equivalent to ''word-break/normal''.
In this style, sequences of CJK characters do not break.
这是一些汉字 and some Latin و کمی خط عربی และตัวอย่างการเขียนภาษาไทย በጽሑፍ፡ማራዘሙን፡አንዳንድ፡The break-points are determined as follows (indicated by ‘·’):
这·是·一·些·汉·字·and·some·Latin·و·کمی·خط·عربی·และ·ตัวอย่าง·การเขียน·ภาษาไทย·በጽሑፍ፡·ማራዘሙን፡·አንዳንድ፡
这·是·一·些·汉·字·a·n·d·s·o·m·e·L·a·t·i·n·و·ﮐ·ﻤ·ﻰ·ﺧ·ﻁ·ﻋ·ﺮ·ﺑ·ﻰ·แ·ล·ะ·ตั·ว·อ·ย่·า·ง·ก·า·ร·เ·ขี·ย·น·ภ·า·ษ·า·ไ·ท·ย·በ·ጽ·ሑ·ፍ፡·ማ·ራ·ዘ·ሙ·ን፡·አ·ን·ዳ·ን·ድ፡
这是一些汉字·and·some·Latin·و·کمی·خط·عربی·และ·ตัวอย่าง·การเขียน·ภาษาไทย·በጽሑፍ፡·ማራዘሙን፡·አንዳንድ፡
Name: line-break Value: auto | loose | normal | strict | anywhere Initial: auto Applies to: text Inherited: yes Canonical order: n/a Computed value: specified keyword Animation type: discrete
GL
, WJ
, or ZWJ
line breaking classes
or mandated by the 'word-break' property.
[[UAX14]]
The different wrapping opportunities must not be prioritized.
Hyphenation is not applied.
CM
and SG
Unicode line breaking classes must be honored.
[[UAX14]]
CJ
.
[[!UAX14]]
ID
[[!UAX14]]
(including when the preceding character
is treated as ID
due to ''word-break: break-all''),
and are otherwise forbidden:
IN
.
[[!UAX14]]
PO
[[!UAX14]]
and the [=East Asian Width property=]
[[!UAX11]]
Ambiguous
,
Fullwidth
,
or Wide
.
PR
[[!UAX14]]
and the [=East Asian Width property=]
[[!UAX11]]
Ambiguous
,
Fullwidth
,
or Wide
.
!
) and
a letter ([=Unicode general category=] L
).
This prevents a break in the string “!important”.
- Not introducing a line break opportunity between
U+002F (Solidus, /
) and
a letter ([=Unicode general category=] L
).
This prevents a break in dates such as “23/Jan/2024”.
- Not introducing a line break opportunity between
U+007C (Vertical Line, |
) and
a letter ([=Unicode general category=] L
).
- Not introducing a line break opportunity between
U+002D (Hyphen-Minus `-`) and
a digit ([=Unicode general category=] Nd
)
if the codepoint prior to the hyphen was _not_ a letter or digit
([=Unicode general category=] L
or Nd
).
This prevents breaking after the minus sign before a number
such as in “-13”
whilst allowing breaks after the hyphen in “ABCD-1234” and “1234-5678”
which may appear in long URLs, for example.
Language | Unbroken | Before | After |
---|---|---|---|
English | Unbroken | Un‐ | broken |
Dutch | cafeetje | café‐ | tje |
Hungarian | Összeg | Ösz‐ | szeg |
Mandarin | tú’àn | tú‐ | àn |
àizēng‐fēnmíng | àizēng‐ | ‐fēnmíng | |
Uyghur |
|
|
|
Cree |
|
|
|
Name: hyphens Value: none | manual | auto Initial: manual Applies to: text Inherited: yes Canonical order: n/a Computed value: specified keyword Animation type: discrete
lang
attribute
or XML xml:lang
attribute)
in order to obtain correct automatic hyphenation.
Name: hyphenate-character Value: auto | <> Initial: auto Applies to: text Inherited: yes Percentages: n/a Computed value: specified keyword Animation type: discrete
[lang]:lang(ojs) { hyphenate-character: "᐀" /* CANADIAN SYLLABICS HYPHEN (U+1400) */ }
Name: hyphenate-limit-zone Value: <> Initial: 0 Applies to: [=block containers=] Inherited: yes Percentages: refers to length of the line box Computed value: computed < > value Animation type: by computed value type
Is 'hyphenate-limit-zone' a good name? Comments/suggestions? This property specifies the maximum amount of unfilled space (before justification) that may be left in the line box before hyphenation is triggered to pull part of a word from the next line back up into the current line.
Name: hyphenate-limit-chars Value: [ auto | <> ]{1,3} Initial: auto Applies to: text Inherited: yes Percentages: n/a Computed value: three values, each either the ''hyphenate-limit-chars/auto'' keyword or an integer Animation type: by computed value type
p { hyphenate-limit-chars: auto 3; }
Name: hyphenate-limit-lines Value: no-limit | <This property indicates the maximum number of successive hyphenated lines in an element. The ''no-limit'' value means that there is no limit. In some cases, user agents may not be able to honor the specified value. (See overflow-wrap.) It is not defined whether hyphenation introduced by such emergency breaking influences nearby hyphenation points.> Initial: no-limit Applies to: block containers Inherited: yes Percentages: n/a Computed value: specified keyword or integer Animation type: by computed value type
Name: hyphenate-limit-last Value: none | always | column | page | spread Initial: none Applies to: [=block containers=] Inherited: yes Percentages: n/a Computed value: specified keyword Animation type: discreteThis property indicates hyphenation behavior at the end of elements, column, pages, and spreads. A spread is a set of two pages that are visible to the reader at the same time. Values have the following meanings:
p { hyphenate-limit-last: always } div.chapter { hyphenate-limit-last: spread }
This is just a simple example to show Antarc- tica.With 'hyphenate-limit-last: always' one would get:
This is just a simple example to show Antarctica.
Name: overflow-wrap, word-wrap Value: normal | break-word | anywhere Initial: normal Applies to: text Inherited: yes Canonical order: n/a Computed value: specified keyword Animation type: discrete
none
value to 'overflow-wrap'
to opt out of relaxing the ''keep-all'' and ''word-break/auto-phrase'' restrictions
as allowed by ''overflow-wrap: normal''?
For legacy reasons, UAs must treat 'word-wrap'
as a [=legacy name alias=] of the 'overflow-wrap' property.
Name: text-align Value: start | end | left | right | center | <> | justify | match-parent | justify-all Initial: start Applies to: block containers Inherited: yes Canonical order: n/a Animation type: discrete
Is this intended to say that it's the centers of the alignment characters that should be aligned? It's not clear that's what it says, but that (or a different behavior) needs to be specified, to describe what happens when different occurrences of the alignment character are in different fonts. (Further, is that the intended behavior? Probably the most significant use case to consider is bold vs. non-bold text, which only varies slightly in width.) [feedback] [minutes face-to-face 2016-02-02 10:00 AM]
TD { text-align: "." center }will cause the column of dollar figures in the following HTML table:
<TABLE> <COL width="40"> <TR> <TH>Long distance calls <TR> <TD> $1.30 <TR> <TD> $2.50 <TR> <TD> $10.80 <TR> <TD> $111.01 <TR> <TD> $85. <TR> <TD> N/A <TR> <TD> $.05 <TR> <TD> $.06 </TABLE>to align along the decimal point. The table might be rendered as follows:
+---------------------+ | Long distance calls | +---------------------+ | $1.30 | | $2.50 | | $10.80 | | $111.01 | | $85. | | N/A | | $.05 | | $.06 | +---------------------+
This needs to specify what text is searched for the alignment character. Is it only in-flow text whose containing block is the cell? Or is text within any in-flow descendants in the block formatting context established by the cell considered? If so, is it considered only as long as its 'text-align' property is consistent with the cell's? (Consistent in the alignment character, or fully consistent?)
This behavior of aligning as though the alignment character
had been inserted at the end of the contents of the cell,
combined with center-of-character alignment,
will produce gaps on the end-side of lines
that are alone on a line with < When the alignment character is inserted
at the end of the contents,
which font is used?
(In particular, if the alignment character might be within a descendant block,
is it the font of the block or the font of the table cell?
Or if the insertion is at a forced break within an inline,
does it use the font of the inline or the font of the block or cell?)
Character-based alignment occurs before table cell width computation
so that auto width computations can leave enough space for alignment.
Whether column-spanning cells participate in the alignment
prior to or after width computation is undefined.
If width constraints on the cell contents prevent
full alignment throughout the column,
the resulting alignment is undefined.
This should have a formal definition
of how character alignment affects
the min-content and max-content intrinsic widths
(of table columns and all content that can be inside table columns).
Max-content intrinsic widths need to be split
into three numbers (assuming that it's the centers of the
alignment character that are aligned):
one for widths without alignment characters,
one for widths on the inline-start side
of the center of the alignment character,
one for widths on the inline-end side
of the center of the alignment character.
This operates based on all segments of text
between forced breaks for max-content widths.
For min-content widths, segments of text between forced breaks
that contain optional breaks within them should clearly contribute
only to the without-alignment-character width.
However, it's less clear
whether all min-content widths should work this way,
or whether segments between forced breaks
that do not have optional breaks
(and perhaps only those that actually contain the alignment character)
should contribute to start-side-of-alignment-character
and end-side-of-alignment-character min-content widths instead;
this choice is a tradeoff between the meaning of min-content
sizing of a table meaning the narrowest reasonable size versus
honoring alignment characters in more cases.
Another option might be to use whether line-breaking of optional breaks
is allowed as a control for which behavior to use.
Formally defining the intrinsic width contributions
of column-spanning cells with <
Authors should use the 'text-align' shorthand instead of this property.
Since optimal justification is [=content language|language=]-sensitive,
authors should correctly language-tag their content for the best results.
Note: The guidelines in this level of CSS
do not describe a complete justification algorithm.
They are merely a minimum set of requirements
that a complete algorithm should meet.
Limiting the set of requirements gives UAs some latitude
in choosing a justification algorithm
that meets their needs and desired balance of quality, speed, and complexity.
abc a b c a b c a b c abbc a b b c a b b c abbc a b b c This further implies that applying 'letter-spacing' to
an element containing only a single character
has no effect on the rendered result:
abc a b c a b c א ב ג Here is some text
Whether [=fullwidth colon punctuation=] and [=fullwidth dot punctuation=]
should be considered [=fullwidth closing punctuation=] or [=fullwidth middle dot punctuation=]
depends on where in the glyph's box the punctuation is drawn.
If the punctuation is centered,
then it should be considered middle dot punctuation.
If the punctuation is drawn to one side (left in horizontal text, top in vertical text)
and the other half is therefore blank
then the punctuation should be considered closing punctuation and trimmed accordingly.
The UA must classify [=fullwidth colon punctuation=] and [=fullwidth dot punctuation=]
under either the [=fullwidth closing punctuation=] category or the [=fullwidth middle dot punctuation=] category
as appropriate.
The UA may rely on language conventions and the writing mode (horizontal vs. vertical),
and/or font information to determine this categorization.
The UA may also add additional characters to any category as appropriate.
Positioning of opening brackets at line head [[JLREQ]]
If 'text-align' is ''text-align/start'' and 'text-indent' is ''5em'' in
left-to-right text with no floats present, then first line of text
will start 5em into the block:
Punctuation is not a phrase by itself:
it should to be attached to the relevant side of an adjacent linguistic word or phrase.
For example,
enclosing punctuation such as brackets and quotes
are part of the phrase they enclose;
commas and semicolons are suffixed to the preceding phrase;
U+00BF INVERTED QUESTION MARK is attached to the subsequent word;
etc.
However, unconventional use of punctuation,
such as smileys, kaomoji, or Perl snippets,
may cause the user agent to need to deviate from this principle.
Default Text Alignment: the 'text-align-all' property
Name: text-align-all
Value: start | end | left | right | center | <
Last Line Alignment: the 'text-align-last' property
Name: text-align-last
Value: auto | start | end | left | right | center | justify | match-parent
Initial: auto
Applies to: block containers
Inherited: yes
Canonical order: n/a
Computed value: keyword as specified, except for ''match-parent'' which computes as defined above
Animation type: discrete
Justification Method: the 'text-justify' property
Name: text-justify
Value: [ auto | none | inter-word | inter-character | ruby ] || no-compress
Initial: auto
Applies to: text
Inherited: yes
Canonical order: n/a
Computed value: specified keyword (except for the ''distribute'' legacy value)
Animation type: discrete
Expanding and Compressing Text
Handling Symbols and Punctuation
Unexpandable Text
Cursive Scripts
Minimum Requirements for ''text-justify/auto'' Justification
Further information on text justification can be found in (or submitted to)
“Approaches to Full Justification”,
which indexes by writing system and language,
and is maintained by the W3C Internationalization Working Group.
[[JUSTIFY]]
Aligning a block of text within its container: the 'text-group-align' property
Name: text-group-align
Value: none | start | end | left | right | center
Initial: none
Applies to: block containers
Inherited: no
Percentages: N/A
Computed value: specified keyword
Animation type: discrete
Spacing
Word Spacing: the 'word-spacing' property
Name: word-spacing
Value: normal | <
Additional spacing is applied to each [=word separator=] left in the text
after the [[#white-space-rules|white space processing rules]] have been applied,
and should be applied half on each side of the character
unless otherwise dictated by typographic tradition.
Values may be negative, but there may be implementation-dependent limits.
Tracking: the 'letter-spacing' property
Name: letter-spacing
Value: normal | <
For legacy reasons,
a computed 'letter-spacing' of zero
yields a [=resolved value=]
({{getComputedStyle()}} return value)
of ''letter-spacing/normal''.
For the purpose of 'letter-spacing',
each consecutive run of [=atomic inlines=]
(such as images and inline blocks)
is treated as a single [=typographic character unit=].
p { letter-spacing: 1em; }
p { letter-spacing: 1em; }
p { letter-spacing: 1em; }
span { letter-spacing: 2em; }
p { letter-spacing: 1em; }
span { letter-spacing: 2em; }
p { letter-spacing: 1em; }
span { letter-spacing: 2em; }
<!-- abc followed by Hebrew letters alef (א), bet (ב) and gimel (ג) -->
<!-- Reordering will display these in reverse order. -->
<p>ab<span>cא</span>בג</p>
A​B
is identical to AB
,
regardless of where any element boundaries might fall.
rlig
feature.
All other ligatures are therefore considered optional.
In some cases, however, UA or platform heuristics
apply additional ligatures in order to handle broken fonts;
this specification does not define or override such exceptional handling.
Cursive Scripts
—
Original text
BAD
Even distribution of space between each letter.
Notice this breaks cursive joins!
OK
Distributing ∑letter-spacing
by typographically-appropriate cursive elongation.
The resulting text is as long as the previous evenly-spaced example.
OK
Suppressing 'letter-spacing' between Arabic letters.
Notice 'letter-spacing' is nonetheless applied
to non-Arabic characters (like [=spaces=]).
BAD
Applying 'letter-spacing' only between non-joined letters.
This distorts typographic color and obfuscates word boundaries.
Line Start/End Padding: the 'line-padding' property
Name: line-padding
Value: <
Whereas 'letter-spacing' adjusts spacing
between typographic character units
and does not apply at the start or end of a line,
this property adjusts spacing only at the start/end of a line.
The extra spacing is applied only
by the innermost inline box
at the start/end of the line box,
and is inserted between that inline box’s content edge
and the adjacent inline-level content
([=text sequence|text=] or atomic inline).
This extra space is not a justification opportunity.
Here is some
text
Automatic Contextual Spacing: the 'text-autospace' property
Name: text-autospace
Value: normal | <
<
This property is additive with the 'word-spacing' and 'letter-spacing' properties.
That is, the amount of spacing contributed by the 'letter-spacing' setting (if any)
is added to the spacing created by 'text-autospace'.
The same applies to 'word-spacing'.
At element boundaries, the amount of extra spacing introduced between characters
is determined by and rendered within the innermost element that contains the boundary.
Z
) already there.
If neither ''text-autospace/insert'' nor ''text-autospace/replace'' are specified,
the behavior is the same as ''text-autospace/insert''.
Z
)
suppress automatic spacing, as for ''text-autospace/insert''.
Note: This is for correcting text which is using the easy-to-type U+0020
instead of proper spacing.
Inter-script Spacing
CJK Punctuation Spacing: the 'text-spacing-trim' property
Name: text-spacing-trim
Value: <
<
This value exists for compat requirements.
This value exists to manage formatting of some existing Chinese and Japanese content,
for which ''trim-both'' would have been appropriate typographically,
except that they are already written
to expect the first line to be set as for ''space-all''.
Specifically,
due to the lack of reliable 'hanging-punctuation' support across UAs,
existing content (especially ePub content)
uses U+3000 ideographic space in place of 'text-indent',
but omits it when the paragraph begins with punctuation
that is desired to hang in the indent
in order to create the hanging punctuation effect.
Using ''trim-both'' on the first line
would thus trim away the effective indent in such content
and thus obscure that line's distinction
as the first line of a new paragraph.
Note that this typesetting practice
of using ideographic spaces for indentation
(sometimes and not always)
is contrary to the separation of content and style offered by HTML and CSS.
Using 'hanging-punctuation' and 'text-indent'
to control paragraph formatting
rather than tweaking the text content of the document
preserves the text’s true semantics in the document source
and allows the style sheet designer
to freely switch among the various spacing/indentation styles
without needing to alter the content.
See [[#japanese-start-edges]] for examples.
Additionally, the behavior at the end of lines is aligned
with the ''text-spacing-trim/normal'' and ''trim-start'' values
rather than ''text-spacing-trim/trim-both'',
in that it only trims the glyphs
if they do not otherwise fit prior to justification.
While improving the typography in fewer cases,
it is closer to the legacy behavior of ''space-all''
which reduces compatibility concerns.
Value
Trim at line start
Trim at line end
Trim adjacent pairs
Trim everywhere
''space-all''
no
''text-spacing-trim/normal''
no
only if would not fit
yes
no
''space-first''
yes except on the first line
''trim-start''
yes
''trim-both''
yes
''trim-all''
yes
''text-spacing-trim/auto''
user-agent specific / platform dependent
Fullwidth Punctuation Collapsing
The UA may use the OpenType halt
and vhal
features
if implemented by a font
in order to perform the requisite trimming of a particular glyph.
The UA must not use the hwid
feature
or otherwise substitute halfwidth forms
as switching to halfwidth glyphs can change the glyph shape
which is not acceptable here.
Some fonts use proportional glyphs for fullwidth punctuation characters.
If there is no support in the font for distinguishing
fullwidth vs halfwidth glyph shapes
(e.g. through font features),
then for such proportional glyphs,
the given advance width is considered
simultaneously full-width and half-width:
the UA must not add or remove space to these glyphs.
ideo
and idtp
baselines for the opposite writing mode,
or by taking the advance width of a Han character such as 水 U+6C34.
(The opposite writing mode must be used because some fonts are compressed
so that the characters are not square.)
More information on OpenType metrics can be found
in the OpenType spec.
Note that if 水 U+6C34, 卜 U+535C, and 一 U+4E00 do not all have the same advance width,
the font has proportional ideographs
and the fullwidth advance width cannot be reliably determined by measuring glyphs.
Some fonts have fullwidth punctuation characters
whose blank are too small to trim (kern.)
UA may choose not to trim (kern)
when the UA determined the trimming (kerning) may cause
glyph cut-offs, collisions, or excessive kerning
through glyph bounding box, glyph metrics, or font features.
If 'text-spacing-trim' is ''trim-all'',
the UA must collapse the space typically associated with such full width glyphs
regardless of the context in which they appear.
Otherwise, unless 'text-spacing-trim' is set to ''space-all''
(or the font has proportional fullwidth punctuation glyphs),
the UA must collapse the space typically associated with such full width glyphs
when placed adjacently on a line
as follows:
Ps
Pe
Combination
Sample Pair
Looks Like
Opening—Opening
〔+(
〔(
Middle Dot—Opening
・+(
・(
Closing—Opening
〕+(
〕(
Ideographic Space—Opening
+(
(
Closing—Closing
)+〕
)〕
Closing—Middle Dot
)+・
)・
Closing—Ideographic Space
)+
)
Text Spacing Character Classes
Ps
)
that belongs to the CJK Symbols and Punctuation block (U+3000–U+303F)
or is categorized as East Asian Fullwidth (F) by [[!UAX11]].
Also includes LEFT SINGLE QUOTATION MARK (U+2018) and LEFT DOUBLE QUOTATION MARK (U+201C).
When trimmed, the left (for horizontal text) or top (for vertical text) half is kerned.
Pe
)
that belongs to the CJK Symbols and Punctuation block (U+3000–U+303F)
or is categorized as East Asian Fullwidth (F) by [[!UAX11]].
Also includes RIGHT SINGLE QUOTATION MARK (U+2019) and RIGHT DOUBLE QUOTATION MARK (U+201D).
May also include [=fullwidth colon punctuation=] and/or [=fullwidth dot punctuation=]
(see below).
When trimmed, the right (for horizontal text) or bottom (for vertical text) half is kerned.
Note that for Chinese fonts at least,
the author observes that the standard convention is often not followed.
colon punctuation dot punctuation
Simplified Chinese (horizontal) closing closing
Simplified Chinese (vertical) closing closing
Traditional Chinese middle dot middle dot
Korean middle dot closing
Japanese middle dot closing
Japanese Paragraph-start Conventions in CSS
p { margin: 1em 0; }
,
CSS can achieve the Japanese typesetting styles with the following rules:
p { /* Flush alignment */
margin: 0;
text-indent: 1em;
text-spacing-trim: trim-both;
}
p { /* Fullwidth alignment */
margin: 0;
text-indent: 1em;
text-spacing-trim: space-all;
}
p { /* Hanging alignment */
margin: 0;
text-indent: 1em;
text-spacing-trim: trim-both;
hanging-punctuation: first;
}
Character Class Spacing Shorthand: the 'text-spacing' property
Name: text-spacing
Value: none | auto | <
Note: As ''text-spacing-trim/normal'' is the initial value of both 'text-spacing-trim' and 'text-autospace',
''text-spacing: normal'' resets both to their initial values.
Shaping Across Element Boundaries
Text shaping must not be broken across inline box boundaries
when there is no effective change in formatting,
or if the only formatting changes do not affect the glyphs
(as in applying text decoration).
Edge Effects
First Line Indentation: the 'text-indent' property
Name: text-indent
Value: [ <
Since CSS1 it has been possible to
indent the first line of a block element
5em by setting the 'text-indent' property
to '5em'.
If we add the ''text-indent/hanging'' keyword,
then the first line will start flush,
but other lines will be indented 5em:
In CSS3 we can instead indent all other
lines of the block element by 5em
by setting the 'text-indent' property
to 'hanging 5em'.
For example, in the middle of
this paragraph is an equation,
which is centered:
x + y = z
The first line after the equation
is flush (else it would look like
we started a new paragraph).
However, sometimes (as in poetry or code),
it is appropriate to indent each line
that happens to be long enough to wrap.
In the following example, 'text-indent'
is given a value of ''3em hanging each-line'',
giving the third line of the poem a hanging indent
where it soft-wraps at the block’s right boundary:
In a short line of text
There need be no wrapping,
But when we go on and on and on
and on,
Sometimes a soft break
Can help us stay on the page.
Hanging Glyphs
Hanging Punctuation: the 'hanging-punctuation' property
Name: hanging-punctuation
Value: none | [ first || [ force-end | allow-end ] || last ]
Initial: none
Applies to: text
Inherited: yes
Canonical order: per grammar
Computed value: specified keyword(s)
Animation type: discrete
At most one punctuation character may [=hang=] at each edge of the line.
Stops and commas allowed to [=hang=] include:
The UA may include other characters as appropriate.
Note: The CSS Working Group would appreciate if UAs including
other characters would inform the working group
of such additions.
U+002C , COMMA
U+002E . FULL STOP
U+060C ، ARABIC COMMA
U+06D4 ۔ ARABIC FULL STOP
U+3001 、 IDEOGRAPHIC COMMA
U+3002 。 IDEOGRAPHIC FULL STOP
U+FF0C , FULLWIDTH COMMA
U+FF0E . FULLWIDTH FULL STOP
U+FE50 ﹐ SMALL COMMA
U+FE51 ﹑ SMALL IDEOGRAPHIC COMMA
U+FE52 ﹒ SMALL FULL STOP
U+FF61 。 HALFWIDTH IDEOGRAPHIC FULL STOP
U+FF64 、 HALFWIDTH IDEOGRAPHIC COMMA
p {
text-align: justify;
hanging-punctuation: allow-end;
}
p {
text-align: justify;
hanging-punctuation: force-end;
}
Bidirectionality and Line Boxes
<block>
is a start-aligned preformatted block
(''display: block; white-space: pre; text-align: start''),
every other line is right-aligned:
שלום!
”, they said.
Appendix A:
Text Processing Order of Operations
Appendix B:
Conversion to Plaintext
Appendix C:
Default UA Stylesheet
/* make option elements align together */
option { text-align: match-parent; }
/* do not allow white space to collapse in textarea */
textarea { white-space-collapse: preserve !important; }
/* preserve character grid in preformatted text */
pre, code, kbd, samp, tt { text-spacing: none; }
/* Avoid hanging punctuation inheriting into preformatted blocks */
pre { hanging-punctuation: none; }
Appendix D:
Scripts and Spacing
User agents should update this list
as they update their Unicode support
to handle as-yet-unencoded cursive scripts in future versions of Unicode,
and are encouraged to ask the CSSWG to update this spec accordingly.
Wide
and Fullwidth
are also included,
but Ambiguous
characters are included
only if the [=writing system=] is
Chinese,
Korean,
or Japanese.
Appendix E:
Characters and Properties
Unicode defines properties for individual code points,
but sometimes it is necessary to determine the properties
of a [=typographic character unit=].
For the purposes of CSS Text,
the properties of a [=typographic character unit=] are given
by the base character of its first [=grapheme cluster=]--
except in two cases:
East_Asian_Width
property
in the Unicode Character Database
[[!UAX44]].
General_Category
property
in the Unicode Character Database
[[!UAX44]].
Script
property
in the Unicode Character Database
[[!UAX44]].
(UAs must include any ScriptExtensions.txt assignments in this mapping.)
Me
)
of the Common script
are considered to be Other Symbols
(So
)
in the Common script.
They are assumed to have the same Unicode properties
as the replacement character (U+FFFD).
Zs
)
as the base
are considered to be Modifier Symbols
(Sk
).
They are assumed to have the same East Asian Width property as the base,
but take their other properties
from the first combining character in the sequence.
Appendix F:
Identifying the Content Writing System
ko-Hani
)
does not use word spaces,
and should therefore be typeset similar to Chinese
rather than modern Korean.
In HTML or any other [=document language=]
using BCP47 tags for identifying languages to declare the [=content language=],
authors can disambiguate or indicate the use of an atypical writing system
with script subtags.
[[BCP47]]
For example, to indicate use of the Latin writing system
for languages which don’t natively use it,
the -Latn
script subtag can be added,
e.g. ja-Latn
for Japanese romaji.
Other subtags exist for other writing systems,
see ISO’s Code for the Representation of Names of Scripts and the ISO15924 script tag registry.
[[ISO15924]]
zh-Latn
ko-Hani
tr-Arab
mn-Cyrl
mn-Mong
Suppress-Script
field in its
language subtag registry
for this purpose.
Note: More advice on language tagging can be found in
the Internationalization Working Group’s
“Language tags in HTML and XML”
and “Choosing a Language Tag”.
When no writing system is explicitly indicated,
UAs should assume the most common writing system
of the declared [=content language=]
for language-sensitive typographic behaviors
such as line-breaking or justification.
However, UAs must not assume that writing system
if the author has explicitly declared a different one.
If the UA has no language-specific knowledge
of a particular language and writing system combination,
it must use the typographic conventions of the declared writing system
(assuming the conventions of a different language if necessary),
not the conventions of the declared language in an assumed writing system,
which would be inappropriate to the declared writing system.
Appendix G:
Small Kana Mappings
Small
Full-size
ぁ U+3041
あ U+3042
ぃ U+3043
い U+3044
ぅ U+3045
う U+3046
ぇ U+3047
え U+3048
ぉ U+3049
お U+304A
ゕ U+3095
か U+304B
ゖ U+3096
け U+3051
𛄲 U+1B132
こ U+3053
っ U+3063
つ U+3064
ゃ U+3083
や U+3084
ゅ U+3085
ゆ U+3086
ょ U+3087
よ U+3088
ゎ U+308E
わ U+308F
𛅐 U+1B150
ゐ U+3090
𛅑 U+1B151
ゑ U+3091
𛅒 U+1B152
を U+3092
ァ U+30A1
ア U+30A2
ィ U+30A3
イ U+30A4
ゥ U+30A5
ウ U+30A6
ェ U+30A7
エ U+30A8
ォ U+30A9
オ U+30AA
ヵ U+30F5
カ U+30AB
ㇰ U+31F0
ク U+30AF
ヶ U+30F6
ケ U+30B1
𛅕 U+1B155
コ U+30B3
ㇱ U+31F1
シ U+30B7
ㇲ U+31F2
ス U+30B9
ッ U+30C3
ツ U+30C4
ㇳ U+31F3
ト U+30C8
ㇴ U+31F4
ヌ U+30CC
ㇵ U+31F5
ハ U+30CF
ㇶ U+31F6
ヒ U+30D2
ㇷ U+31F7
フ U+30D5
ㇸ U+31F8
ヘ U+30D8
ㇹ U+31F9
ホ U+30DB
ㇺ U+31FA
ム U+30E0
ャ U+30E3
ヤ U+30E4
ュ U+30E5
ユ U+30E6
ョ U+30E7
ヨ U+30E8
ㇻ U+31FB
ラ U+30E9
ㇼ U+31FC
リ U+30EA
ㇽ U+31FD
ル U+30EB
ㇾ U+31FE
レ U+30EC
ㇿ U+31FF
ロ U+30ED
ヮ U+30EE
ワ U+30EF
𛅤 U+1B164
ヰ U+30F0
𛅥 U+1B165
ヱ U+30F1
𛅦 U+1B166
ヲ U+30F2
𛅧 U+1B167
ン U+30F3
ァ U+FF67
ア U+FF71
ィ U+FF68
イ U+FF72
ゥ U+FF69
ウ U+FF73
ェ U+FF6A
エ U+FF74
ォ U+FF6B
オ U+FF75
ッ U+FF6F
ツ U+FF82
ャ U+FF6C
ヤ U+FF94
ュ U+FF6D
ユ U+FF95
ョ U+FF6E
ヨ U+FF96
Appendix H:
Word and Phrase Detection
The start and end position of each detected word or phrase
is called a word boundary or phrase boundary.
By themselves, word and phrase boundaries are not observable,
but properties like 'word-space-transform' or 'word-break'
can cause visible effects at those positions.
The specific algorithm to detect word or phrases
and to place their boundaries is UA-dependent,
and may take into account a variety of factors or approaches,
such as
dictionary-based lexical analysis,
identification of punctuation or other delimiting characters,
morphological analysis,
machine learning methods…
The following constraints must nevertheless be respected:
|
” indicates
reasonable positions for a user agent [=detecting word boundaries=] to place them:
If that sentence had contained some inline markup,
the following example shows the correct position to place the word boundaries:
กรุงเทพ|คือ|สวยงาม
The following example shows incorrect positions:
กรุงเทพ|คือ|<em>สวยงาม</em>
The following shows the correct positions in a more contrived situation:
กรุงเทพ|คือ<em>|สวยงาม</em>
กรุงเทพ|<b><u>คือ</u>|<em>สวยงาม</em></b>
Security Considerations
Privacy Considerations
Acknowledgements
Changes
This draft is kept in sync with [[CSS-TEXT-3]], see [[css-text-3#changes]].
Changes specific to Level 4 are listed below.
Significant changes since the 29 May 2024 Working Draft include:
* None yet.
Significant changes since the 19 February 2024 Working Draft include:
* Renamed the 'text-spacing-trim' value word-boundary-detection
property),
and add an ''word-space-transform/auto-phrase'' value to 'word-space-transform'
(since it can no longer depend on word-boundary-detection
).
and update supporting related mechanics.
* Rename word-boundary-expansion
to 'word-space-transform'
* Add ''trim-all'' to 'text-spacing-trim'.
(Issue 8482)
* Non-tailorable Unicode line breaking controls other than NBSP
take precedence over our rule about atomic inlines.
(Issue 8972)
Pe
and Ps
categories.
(Issue 6091)
* Renamed
Significant changes since the 2019 Working Draft include:
Additions Since Level 3
New features in Level 4:
* ''word-break: auto-phrase'', for automaticly determining phrases to keep together while line breaking
* 'word-space-transform', for transforming word separators
* breaking up of the 'white-space' property into multiple longhands:
* 'white-space-collapse' and its ''preserve-spaces'' and ''white-space-collapse/discard'' values
* 'white-space-trim', for trimming excess white space at the boundaries of an element
* 'text-wrap-mode' to control whether wrapping occurs or not
* 'text-wrap-style' and its ''balance'', ''stable'', and ''pretty'' values
* 'wrap-before', 'wrap-after', and 'wrap-inside', to avoid or force wrapping (similar to the 'break-*' properties for pagination)
* 'hyphenate-character', to explicitly control the hyphenation character
* 'hyphenate-limit-zone', 'hyphenate-limit-chars', 'hyphenate-limit-lines', 'hyphenate-limit-last', for better control over automatic hyphenation
* <