content icon indicating copy to clipboard operation
content copied to clipboard

"word-break: normal;" !== "word-break: break-word;"

Open feastdesignco-user opened this issue 3 years ago • 4 comments

MDN URL

https://developer.mozilla.org/en-US/docs/Web/CSS/word-break

What specific section or headline is this issue about?

Deprecation note

What information was incorrect, unhelpful, or incomplete?

Note: While word-break: break-word is deprecated, it has the same effect, when specified, as word-break: normal

This is incorrect, as demonstrated by the on-page example: image

word-break: normal; and word-break: break-word;

Function entirely different.

What did you expect to see?

Correct information.

Do you have any supporting links, references, or citations?

The on-page example demonstrates that this is false: https://developer.mozilla.org/en-US/docs/Web/CSS/word-break

Do you have anything more you want to share?

Google Chrome Version 112.0.5615.49 (Official Build) (arm64)

MacOS Ventura Version 13.2.1

MDN metadata

Page report details
  • Folder: en-us/web/css/word-break
  • MDN URL: https://developer.mozilla.org/en-US/docs/Web/CSS/word-break
  • GitHub URL: https://github.com/mdn/content/blob/main/files/en-us/web/css/word-break/index.md
  • Last commit: https://github.com/mdn/content/commit/b82ff59aab7883b7bb2222cf9f9f9b6eed818e08
  • Document last modified: 2023-02-21T06:13:19.000Z

feastdesignco-user avatar May 24 '23 10:05 feastdesignco-user

The actual note is:

Note: While word-break: break-word is deprecated, it has the same effect, when specified, as word-break: normal and overflow-wrap: anywhere[…]

which is indeed true on Firefox.

yarusome avatar May 24 '23 11:05 yarusome

Checked in Firefox 113.0.2 (64-bit)

And normal and break-word behave entirely different:

image

It's not true on Firefox either.

feastdesignco-user avatar May 24 '23 11:05 feastdesignco-user

@feastdesignco What @yarusome meant is that the note also tells you to add overflow-wrap: anywhere in order for word-break: normal to achieve the effect of break-word.

Josh-Cena avatar May 24 '23 12:05 Josh-Cena

Can confirm that combining both properties gives the intended effect.

Can the documentation then be changed to overflow-wrap: anywhere; combined with word-break: normal;

As it's currently written it's not clear that both properties are required to be combined.

feastdesignco-user avatar May 24 '23 13:05 feastdesignco-user