InfoHeap
Tech
Navigation
  • Home
  • Tutorials
    • CSS tutorials & examples
    • CSS properties
    • Javascript cookbook
    • Linux/Unix Command Line
    • Mac
    • PHP
      • PHP functions online
      • PHP regex
    • WordPress
  • Online Tools
    • Text utilities
    • Online Lint Tools
search

CSS properties

  • CSS3 flexbox
  • all
  • animation
  • background-color
  • background-image
  • border
  • border-color
  • border-radius
  • border-style
  • border-width
  • bottom
  • box-shadow
  • box-sizing
  • calc function
  • clip
  • color
  • color value currentColor
  • color values
  • cursor
  • float
  • font
  • font-family
  • font-size
  • font-style
  • font-variant
  • font-weight
  • generated content
  • left
  • letter-spacing
  • line-height
  • list-style
  • list-style-image
  • list-style-position
  • list-style-type
  • margin
  • max-height
  • max-width
  • min-height
  • min-width
  • opacity
  • outline
  • outline-color
  • outline-style
  • outline-width
  • overflow
  • padding
  • pointer-events
  • position
  • resize
  • right
  • text-align
  • text-decoration
  • text-indent
  • text-overflow
  • text-shadow
  • text-transform
  • top
  • transform
  • transition
  • transition-delay
  • transition-duration
  • transition-property
  • transition-timing-function
  • visibility
  • white-space
  • word-break
  • word-spacing
  • word-wrap/overflow-wrap
  • z-index
 
  • Home
  • > Tutorials
  • > CSS
  • > CSS properties

CSS word-break – specify line breaking rules between letters

on Mar 20, 2016

CSS property word-break specifies line breaking rules between letters. Note that this different from word-wrap which applies when word does not fit in line box.

CSS property word-break

CSS version: CSS 3
Value: normal | keep-all | break-all
Initial: normal
Inherited: yes
Animatable: no

word-break values

normalWords are broken according to usual rules.
break-allIn addition to normal break points, word may break at any point.
keep-allBreaks are prohibited between pairs of letters. This is more applicable for CJK words. For other words it behaves same as normal.

Example – normal and break-all word-break

  1. normal: word will only break at natural break points (like dash).
  2. break-all: word will break anywhere between two letters.
In the following code, CSS property word-break can be changed to the following values
  • normal
  • break-all
<style> 
.box {
  width: 100px; 
  background-color: lightgreen;
  word-break: normal;
}
</style>
<div class="box">
This is some text containing 
some very-longwords
</div>
word-break refresh done
try it online

Related

  • CSS word-wrap/overflow-wrap - specify if a word can break anywhere

Specification

  • W3C CSS 3 word-break specification

Suggested posts:

  1. Recursive grep and excluding directory
  2. CSS letter-spacing – additional spacing between adjacent chars
  3. CSS selector specificity
  4. WordPress – write custom php log to separate file
  5. PHP regex – whitespace shorthand (\s) regex examples
  6. PHP regex – match any digit
  7. CSS text-indent – indent text in a block
  8. CSS attribute presence and value selectors
Share this article: share on facebook share on linkedin tweet this submit to reddit
Posted in Tutorials | Tagged CSS, CSS properties, Tutorials
  • Browse content
  • Article Topics
  • Article archives
  • Contact Us
Popular Topics: Android Development | AngularJS | Apache | AWS and EC2 | Bash shell scripting | Chrome developer tools | Company results | CSS | CSS cookbook | CSS properties | CSS Pseudo Classes | CSS selectors | CSS3 | CSS3 flexbox | Devops | Git | HTML | HTML5 | Java | Javascript | Javascript cookbook | Javascript DOM | jQuery | Kubernetes | Linux | Linux/Unix Command Line | Mac | Mac Command Line | Mysql | Networking | Node.js | Online Tools | PHP | PHP cookbook | PHP Regex | Python | Python array | Python cookbook | SEO | Site Performance | SSH | Ubuntu Linux | Web Development | Webmaster | Wordpress | Wordpress customization | Wordpress How To | Wordpress Mysql Queries | InfoHeap Money

Copyright © 2025 InfoHeap.

Powered by WordPress