MDN The hanging-punctuationCSS property specifies whether a punctuation mark should hang at the start or end of a line of text. Hanging punctuation may be placed outside the line box.
<p> «For a moment, nothing happened. Then, after a second or so, nothing continued to happen.»</p><p class="hanging"> «For a moment, nothing happened. Then, after a second or so, nothing continued to happen.»</p><p class="hanging right"> «For a moment, nothing happened. Then, after a second or so, nothing continued to happen.»</p>
Syntax
none | [ first || [ force-end | allow-end ] || last ]
Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
Definition
Initial
none
Applies to
text
Inherited
yes
Percentages
n/a
Computed value
specified keyword(s)
Canonical order
per grammar
Animation type
discrete
Browser support
First browser version supporting hanging-punctuation
Chrome
No
Edge
No
Firefox
No
Safari
26.5
Chrome Android
No
Safari iOS
26.5
First version with support, from MDN browser-compat-data.
MDN The hyphenate-limit-charsCSS property specifies the minimum word length to allow hyphenation of words as well as the minimum number of characters before and after the hyphen.
<div class="container"> <p id="ex1">juxtaposition and acknowledgement</p> <p id="ex2">juxtaposition and acknowledgement</p> <p id="ex3">juxtaposition and acknowledgement</p> <p id="ex4">juxtaposition and acknowledgement</p></div>
Syntax
[ auto | <integer [0,∞]> ]{1,3}
Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
Definition
Initial
auto
Applies to
text
Inherited
yes
Percentages
n/a
Computed value
three values, each either the auto keyword or an integer
Canonical order
per grammar
Animation type
by computed value type
Browser support
First browser version supporting hyphenate-limit-chars
Chrome
109
Edge
109
Firefox
137
Safari
Preview
Chrome Android
109
Safari iOS
No
First version with support, from MDN browser-compat-data.
PropertyBaseline: widely availablesince January 2018
MDN The letter-spacingCSS property sets the spacing between text characters. This value is added to the natural spacing between characters while rendering the text. Positive values of letter-spacing spread characters further apart, while negative values of letter-spacing bring characters closer together.
<section id="default-example"> <p id="example-element"> As much mud in the streets as if the waters had but newly retired from the face of the earth, and it would not be wonderful to meet a Megalosaurus, forty feet long or so, waddling like an elephantine lizard up Holborn Hill. </p></section>
Syntax
normal | <length-percentage>
Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
Definition
Initial
normal
Applies to
inline boxes and text
Inherited
yes
Percentages
relative to used font-size
Computed value
an absolute length and/or a percentage
Canonical order
n/a
Animation type
by computed value type
Browser support
First browser version supporting letter-spacing
Chrome
1
Edge
12
Firefox
1
Safari
1
Chrome Android
18
Safari iOS
1
First version with support, from MDN browser-compat-data.
PropertyBaseline: widely availablesince April 2021
MDN The overflow-wrapCSS property applies to text, setting whether the browser should insert line breaks within an otherwise unbreakable string to prevent text from overflowing its line box.
<section class="default-example" id="default-example"> <div class="example-container"> Most words are short & don't need to break. But <strong class="transition-all" id="example-element" >Antidisestablishmentarianism</strong > is long. The width is set to min-content, with a max-width of 11em. </div></section>
Syntax
normal | break-word | anywhere
Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
Definition
Initial
normal
Applies to
text
Inherited
yes
Percentages
n/a
Computed value
specified keyword
Canonical order
n/a
Animation type
discrete
Browser support
First browser version supporting overflow-wrap
Chrome
23
Edge
18
Firefox
49
Safari
7
Chrome Android
25
Safari iOS
7
First version with support, from MDN browser-compat-data.
PropertyBaseline: widely availablesince January 2018
MDN The text-alignCSS property sets the horizontal alignment of the inline-level content inside a block element or table-cell box. This means it works like vertical-align but in the horizontal direction.
Live previewExample from MDN
section { font-size: 1.5em;}#default-example > div { width: 250px;}
<section id="default-example"> <div id="example-element"> <p> Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. </p> </div></section>
Syntax
start | end | left | right | center | <string> | justify | match-parent | justify-all
Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
<section id="default-example"> <div> <p id="example-element"> Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. </p> </div></section>
Syntax
auto | start | end | left | right | center | justify | match-parent
Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
Definition
Initial
auto
Applies to
block containers
Inherited
yes
Percentages
n/a
Computed value
keyword as specified, except for match-parent which computes as defined above
Canonical order
n/a
Animation type
discrete
Browser support
First browser version supporting text-align-last
Chrome
47
Edge
12
Firefox
49
Safari
16
Chrome Android
47
Safari iOS
16
First version with support, from MDN browser-compat-data.
MDN The text-fitCSS property can be used to scale the rendered font size of text nodes (and other inline content) so that they fit exactly within the inline dimension of their containing boxes, optionally limited by a maximum or minimum scaling factor.
<input type="range" min="0.4" max="1" value="1" step="0.01" aria-label="adjust the width of the page" /><div> <h1>My heading</h1> <h2>My subtitle: a bit longer, may need shrinking</h2></div>
<section id="default-example"> <div id="example-element"> <p> This text is contained within a single paragraph. This paragraph is two sentences long. </p> <p> This is a new paragraph. There is a line break element <code><br></code> after this sentence.<br />There it is! Notice how it affects the indentation. </p> </div></section>
Syntax
[ <length-percentage> ] && hanging? && each-line?
Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
Definition
Initial
0
Applies to
block containers
Inherited
yes
Percentages
refers to block container’s own inline-axis inner size
Computed value
computed <length-percentage> value, plus any specified keywords
Canonical order
per grammar
Animation type
by computed value type
Browser support
First browser version supporting text-indent
Chrome
1
Edge
12
Firefox
1
Safari
1
Chrome Android
18
Safari iOS
1
First version with support, from MDN browser-compat-data.
<p class="none"> <code>text-justify: none</code> —<br />Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc ornare maximus vehicula. Duis nisi velit, dictum id mauris vitae, lobortis pretium quam. Quisque sed nisi pulvinar, consequat justo id, feugiat leo. Cras eu elementum dui.</p><p class="auto"> <code>text-justify: auto</code> —<br />Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc ornare maximus vehicula. Duis nisi velit, dictum id mauris vitae, lobortis pretium quam. Quisque sed nisi pulvinar, consequat justo id, feugiat leo. Cras eu elementum dui.</p><p class="dist"> <code>text-justify: distribute</code> —<br />Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc ornare maximus vehicula. Duis nisi velit, dictum id mauris vitae, lobortis pretium quam. Quisque sed nisi pulvinar, consequat justo id, feugiat leo. Cras eu elementum dui.</p><p class="word"> <code>text-justify: inter-word</code> —<br />Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc ornare maximus vehicula. Duis nisi velit, dictum id mauris vitae, lobortis pretium quam. Quisque sed nisi pulvinar, consequat justo id, feugiat leo. Cras eu elementum dui.</p><p class="char"> <code>text-justify: inter-character</code> —<br />Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc ornare maximus vehicula. Duis nisi velit, dictum id mauris vitae, lobortis pretium quam. Quisque sed nisi pulvinar, consequat justo id, feugiat leo. Cras eu elementum dui.</p>
MDN The text-spacing-trimCSS property controls the internal spacing set on Chinese/Japanese/Korean (CJK) punctuation characters between adjacent characters (kerning) and at the start or end of text lines.
MDN The text-transformCSS property specifies how to capitalize an element's text. It can be used to make text appear in all-uppercase or all-lowercase, or with each word capitalized. It also can help improve legibility for ruby.
Live previewExample from MDN
#example-element { font-size: 1.2em;}
<section id="default-example"> <div class="transition-all" id="example-element"> <p> LONDON. Michaelmas term lately over, and the Lord Chancellor sitting in Lincoln's Inn Hall. </p> <p lang="el"> Σ is a Greek letter and appears in ΟΔΥΣΣΕΥΣ. Θα πάμε στο "Θεϊκό φαΐ" ή στη "Νεράιδα" </p> <p lang="ja">ァィゥェ ォヵㇰヶ</p> </div></section>
<section class="default-example" id="default-example"> <div class="whole-content-wrapper"> <p>Edit the text in the box:</p> <div class="transition-all" id="example-element"> <p contenteditable> Lorem ipsum dolor sit amet consectetur adipisicing elit. Voluptatem aut cum eum id quos est. </p> </div> </div></section>
Syntax
<'text-wrap-mode'> || <'text-wrap-style'>
Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
<section class="default-example" id="default-example"> <div class="whole-content-wrapper"> <p>Edit the text in the box:</p> <div class="transition-all" id="example-element"> <p contenteditable> You can edit this lorem ipsum dolor sit amet consectetur adipisicing elit. Voluptatem aut cum eum id quos est text. </p> </div> </div></section>
Syntax
wrap | nowrap
Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
Definition
Initial
wrap
Applies to
text
Inherited
yes
Percentages
n/a
Computed value
specified keyword
Canonical order
per grammar
Animation type
discrete
Browser support
First browser version supporting text-wrap-mode
Chrome
130
Edge
130
Firefox
124
Safari
17.4
Chrome Android
130
Safari iOS
17.4
First version with support, from MDN browser-compat-data.
MDN The text-wrap-styleCSS property controls how text inside an element is wrapped, providing alternate ways of determining where to create line breaks in order to fit the content within a block element.
<section class="default-example" id="default-example"> <div class="whole-content-wrapper"> <p>Edit the text in the box:</p> <div class="transition-all" id="example-element"> <p contenteditable> Lorem ipsum dolor sit amet consectetur adipisicing elit. Voluptatem aut cum eum id quos est. </p> </div> </div></section>
Syntax
auto | balance | stable | pretty | avoid-short-last-line
Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
Definition
Initial
auto
Applies to
block containers hat establish an inline formatting context
Inherited
yes
Percentages
n/a
Computed value
specified keyword
Canonical order
per grammar
Animation type
discrete
Browser support
First browser version supporting text-wrap-style
Chrome
130
Edge
130
Firefox
124
Safari
17.5
Chrome Android
130
Safari iOS
17.5
First version with support, from MDN browser-compat-data.
<section class="default-example" id="default-example"> <div id="example-element"> <p> But ere she from the church-door stepped She smiled and told us why: 'It was a wicked woman's curse,' Quoth she, 'and what care I?' She smiled, and smiled, and passed it off Ere from the door she stept— </p> </div></section>
Syntax
normal | pre | pre-wrap | pre-line | <'white-space-collapse'> || <'text-wrap-mode'> || <'white-space-trim'>
Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
<section id="default-example"> <p id="example-element"> As much mud in the streets as if the waters had but newly retired from the face of the earth, and it would not be wonderful to meet a Megalosaurus, forty feet long or so, waddling like an elephantine lizard up Holborn Hill. </p></section>
Syntax
normal | <length-percentage>
Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
Definition
Initial
normal
Applies to
text
Inherited
yes
Percentages
relative to used font-size
Computed value
an absolute length and/or a percentage
Canonical order
n/a
Animation type
by computed value type
Browser support
First browser version supporting word-spacing
Chrome
1
Edge
12
Firefox
1
Safari
1
Chrome Android
18
Safari iOS
1
First version with support, from MDN browser-compat-data.