CSS hyphenate-limit-chars Property

Description

The CSS hyphenate-limit-chars property specifies the minimum word length to allow hyphenation of words as well as the minimum number of characters before and after the hyphen. This property provides you with fine-grained control over hyphenation in text. For example, you could use hyphenate-limit-chars to prevent words from being hyphenated if they are less than 10 characters long, or to ensure that there are always at least three characters before and after a hyphen. This control enables you to avoid awkward hyphenations and set appropriate hyphenation for different languages, which, in turn, allows for better typography.

Initial value
auto
Applies to
all elements
Inherited
yes
Computed value
as specified
Animatable
by computed value type
JavaScript syntax
object.style.hyphenateLimitChars

Syntax

hyphenate-limit-chars: [ auto | <integer> ]{1,3}

Values

  • [ auto | <integer> ]{1,3}The first value is the minimum word length before words should be hyphenated. The second value is the minimum number of characters before the hyphen. The third value is the minimum number of characters after the hyphen. If auto is set for any of the values, the user agent will choose an appropriate value for the current layout.

Example

p {
  hyphens: auto;
  hyphenate-limit-chars: 10 3 4;
}

Browser Support

The following table will show you the current browser support for the CSS hyphenate-limit-chars property.

Desktop
Edge Chrome Firefox Opera Safari
109109x95x
Tablets / Mobile
Chrome Firefox Opera Safari Samsung Webview
109x74x21109

Last updated by CSSPortal on: 31st December 2023