Tillitsdone
down Scroll to discover

CSS Word-Break Enhancing Text Wrapping for Better Readability

Explore the CSS word-break property to manage text overflow and improve readability.

Learn about available options like normal, break-all, keep-all, and break-word.
thumbnail

Introduction

The word-break CSS property helps control how text breaks at the end of a line. By default, text breaks at spaces or hyphens, but word-break gives you more control, especially for handling long words or complex languages like Chinese, Japanese, and Korean (CJK).

Specification

The word-break property is defined in the CSS Text Module Level 3 specification.

Values

Here are the main values for word-break:

normal

  • Default behavior: breaks at spaces or hyphens.

break-all

  • Breaks between any two characters (except CJK text) to prevent overflow.

keep-all

  • Prevents breaks in CJK text; non-CJK text behaves normally.

break-word

  • Similar to overflow-wrap: anywhere combined with word-break: normal, ensuring words break at appropriate points.

Global Values

  • inherit: Inherits the value from the parent element.
  • initial: Sets the property to its default value.
  • revert: Resets the property to the browser’s default.
  • revert-layer: Resets the property to the value established by the user-agent stylesheet.
  • unset: Resets the property to its inherited value if it inherits, otherwise to its initial value.

Formal Definition

The word-break property specifies how text should break at the end of a line. It’s crucial for managing text overflow and ensuring readability.

Initial Value:

  • normal

Applies To:

  • All elements

Inherited:

  • Yes

Computed Value:

  • As specified

Animation Type:

  • Discrete

Formal Syntax

The formal syntax for the word-break property is:

word-break: normal | break-all | keep-all | break-word | initial | inherit;

Browser Compatibility

The word-break property is widely supported across modern browsers:

  • Google Chrome: Since version 4.0 (January 2010)
  • Mozilla Firefox: Since version 15.0 (August 2012)
  • Microsoft Edge: Since version 12 (July 2015)
  • Microsoft Internet Explorer: Since version 5.5 (July 2000)
  • Opera: Since version 15.0 (May 2013)
  • Safari: Since version 3.1 (March 2008)

For the latest details, check [Browser Compatibility Data]WebsiteUrl.

Using the word-break property effectively ensures your web designs are functional and look great across different browsers and devices.

icons/css-4.svg CSS Blogs
CSS3 is the latest version of Cascading Style Sheets, offering advanced styling features like animations, transitions, shadows, gradients, and responsive design.
icons/logo-tid.svg

Talk with CEO

Ready to bring your web/app to life or boost your team with expert Thai developers?
Contact us today to discuss your needs, and let’s create tailored solutions to achieve your goals. We’re here to help at every step!
🖐️ Contact us
Let's keep in Touch
Thank you for your interest in Tillitsdone! Whether you have a question about our services, want to discuss a potential project, or simply want to say hello, we're here and ready to assist you.
We'll be right here with you every step of the way.
Contact Information
rick@tillitsdone.com+66824564755
Find All the Ways to Get in Touch with Tillitsdone - We're Just a Click, Call, or Message Away. We'll Be Right Here, Ready to Respond and Start a Conversation About Your Needs.
Address
9 Phahonyothin Rd, Khlong Nueng, Khlong Luang District, Pathum Thani, Bangkok Thailand
Visit Tillitsdone at Our Physical Location - We'd Love to Welcome You to Our Creative Space. We'll Be Right Here, Ready to Show You Around and Discuss Your Ideas in Person.
Social media
Connect with Tillitsdone on Various Social Platforms - Stay Updated and Engage with Our Latest Projects and Insights. We'll Be Right Here, Sharing Our Journey and Ready to Interact with You.
We anticipate your communication and look forward to discussing how we can contribute to your business's success.
We'll be here, prepared to commence this promising collaboration.
Frequently Asked Questions
Explore frequently asked questions about our products and services.
Whether you're curious about features, warranties, or shopping policies, we provide comprehensive answers to assist you.