A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/w3c/csswg-drafts/issues/3463 below:

[css-text] Prevent line break after hyphen preceded by space · Issue #3463 · w3c/csswg-drafts · GitHub

I want to prevent a line break after a hyphen that is preceded by a space.

So a string like

foo bar -baz

can be broken as

foo bar
-baz

but not

foo bar -
baz

I’m not sure if this can be solved by CSS spec (e.g., a new keyword for hyphens or overflow-wrap, etc.) or if it’s a browser bug: Firefox does like described by default, Chrome doesn’t.

(Demo: https://codepen.io/valtlai/pen/WLRjeo/left/?editors=1100)

Another example

String:

foo -webkit-baz

Allowed:

foo -webkit-
baz

Disallowed:

foo -
webkit-baz

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4