In the web version of a family book, a heading can be thoroughly proofread and still display its colon alone at the start of a line. Fixing the character placed before the punctuation mark is often the first step people consider. Yet if the flaw persists, replacing that same space again does not necessarily solve the problem. Layout also depends on HTML structure and on the CSS rules applied to the text.
To examine these differences, we first built ten variants of a short French phrase, La transmission : demain, and recorded how they laid out in a real browser. The goal chosen for this exercise is twofold: keep the colon together with the word “transmission” and maintain a visible gap between them. We also need to verify that the unit fits inside its column. These three requirements are not the same, as the test proofs show.
Receive the “Pantheon of 28 Legendary Chefs” Dossier (Free A4 PDF) + 5 Audio Stories
Instant complimentary access to our illustrated gastronomic & historical dossier, plus 5 DRM-free MP3 audio chronicles.
What We Actually Measured
The tests ran in a temporary Chrome profile with access to external pages blocked. The browser reported version 157.0.8103.78. Our stylesheet requests Arial at 24 pixels with a 36-pixel line height; we did not identify the exact font file actually used by the system. The results describe this phrase and this configuration, without comparing other browsers or book-reading software.
Each of the first ten variants was examined across 191 consecutive widths, from 80 to 270 CSS pixels, totaling 1,910 layouts. The script recorded character bounding boxes and compared the vertical position of the colon with that of the final letter of the preceding word. A shared vertical position here means “same line.” We also recorded the inner width of the box and the width of its content: bound punctuation can still overflow its frame.
The stated width includes both one-pixel borders. At 144 CSS pixels, the inner space is therefore 142 pixels in our setup. That detail matters when comparing 148 pixels of content against the available room. We do not treat these numbers as paper dimensions, nor do we turn them into a universal minimum size for a heading.
Three screenshots at 112, 160, and 210 pixels were inspected, and a targeted pass at 144 pixels produced a fourth image. That last check makes visible a case the earlier images did not show: under an emergency wrapping rule, the colon really does move to the start of the next line. The geometric measurements are thus cross-checked against visible rendering, without claiming a pixel-by-pixel inspection of all 1,910 layouts.
An Unnoticed Space Can Alter the Group
The Unicode Line Breaking Algorithm report distinguishes the non-breaking space U+00A0 from the narrow no-break space U+202F; it places both in the same glue class. It also describes the case of an ordinary space placed before a non-breaking space, which can reintroduce a break opportunity. We will examine exact character strings rather than assuming every space that looks narrow behaves the same way.
In the first variant, an ordinary space separates the word and the colon. The mark ends up on a separate line at certain widths, though not at all of them. At 160 CSS pixels, the group stays together; at 178, it splits. At 184, it rejoins. This sequence is not a counting error: as the width changes, the rest of the phrase can reflow differently. A narrower line does not shift every character in a purely monotonic progression.
The variant with a single non-breaking space, by contrast, keeps the colon with the final letter of the word across our entire measured range. The narrow no-break space does the same. That establishes a difference from the first string in this test; it does not yet mean that each of these layouts is usable inside the intended column. We will return to frame overflow after isolating another text issue.
Now add an ordinary space immediately before the non-breaking space. At 178 pixels, the colon now separates from the word, whereas the single non-breaking space variant keeps them together. The non-breaking space is genuinely present in both strings; searching for that character alone is not enough to tell them apart. The space preceding it is part of the diagnosis.
In our files, removing that extra space brings us back exactly to the single non-breaking space string already measured. Adding a second non-breaking space without removing the ordinary space would not be the same fix. On a real page showing this issue, you have to inspect the character sequence around the punctuation mark, rather than merely asking whether “a non-breaking space was added.” The difference between the two variants comes down to a specific character, not a vague impression of a wider or narrower gap.
The Same String Can Change Under a CSS Rule
Now let us keep the exact text of the non-breaking space variant. We created another layout by changing only the overflow rule: overflow-wrap: anywhere. The CSS Text module provides this emergency break mechanism for a sequence that otherwise could not fit on its line. It also specifies that this mechanism assumes line wrapping is permitted.
In this variant, none of the tested widths shows overflow in our measurements. On the other hand, between 137 and 150 CSS pixels, the colon no longer stays on the same line as the preceding letter. At 144 pixels, the screenshot shows the word on one line and the colon at the start of the next. The rule solved a width problem by abandoning, in this case, the bond we wanted to preserve.
The comparison is especially clear at that width. Without the emergency rule, the group stays bound, but its content measures 148 pixels for 142 available. With the rule, it no longer overflows, but the punctuation splits off. You therefore cannot check only for the absence of overflow and conclude that typesetting has met our goal. The two checks give different answers.
The text of the two variants is identical, character for character. The visible flaw therefore does not prove that a processing step replaced the non-breaking space with an ordinary space. If you corrected that string again without inspecting its layout rule, you would leave the real cause untouched. Nor does our test require removing the fallback mechanism everywhere: a very long URL or another element may have its own wrapping needs. It shows why the rule must be evaluated right where it takes effect.
A Forced Break and a Break Opportunity Are Not Equivalent
Next, we kept the same non-breaking string while inserting, right before the colon, either a br element or a wbr element. The HTML standard defines the first as a line break and the second as a line-break opportunity. Both operations deserve to be distinguished before hunting for a fix in the spaces.
In the variant with a forced break, the colon is separated from the word at all 191 widths tested. It is still separated at 210 pixels, whereas the non-breaking variant without that element keeps them on the first line. Widening the column within our test range therefore does not eliminate this separation. The text is not simply waiting for enough room to open up.
The variant with an added break opportunity behaves differently. At 160 pixels, the mark stays with the word; at 178, it moves to the next line; at 184, the group rejoins. Had we checked only the first of those widths, we might have missed the effect of that element. Had we checked only the second, we might have mistaken it for a forced break. The three measurements make it possible to tell the difference in our examples.
Here is a crucial finding for anyone handing text off to a layout designer: all three variants—non-breaking space alone, forced break, and break opportunity—expose the exact same text field read by our script, called textContent. Their code points there are identical. Yet their HTML differs, and so do the observed line breaks. This comparison does not test the clipboard: it examines a property read from the document by the script.
Sending only that text string would therefore not allow anyone to reconstruct which of our three documents produced the flaw. You must preserve the responsible element in the sample you hand over, or at least describe it precisely. This also explains why re-importing a text believed to be clean several times can leave the problem intact: the text transmitted and the markup structure in which it sits are not the same piece of work.
Keeping the Bond Does Not Guarantee the Group Fits
The table summarizes several observations at a CSS width of 144 pixels. The inner room of each box is 142 pixels. The content values are those returned by our browser, not guaranteed typographic widths for this phrase on every device.
Scroll the table horizontally if needed.
| Test variant | Colon with preceding letter | Measured content width | Result to review |
|---|---|---|---|
| Single non-breaking space | Yes | 148 px | Group bound, but overflows |
| Narrow no-break space | Yes | 145 px | Group bound, but overflows |
| Emergency wrap rule | No | 142 px | No overflow, bond lost |
| Soft wraps disabled | Yes | 267 px | Entire phrase overflows |
Here, the narrow no-break space reduces the width of the group compared with the regular non-breaking space, but not enough to fit its content into 142 pixels. It therefore does not provide a complete solution at this width. We do not conclude that it is useless: we simply separate the observed reduction from the goal that remains unmet.
We also tried disabling all soft wraps with white-space: nowrap. CSS Text defines this mode as preventing soft line wraps. In our tests, the colon stays bound to the word, but the entire content reaches 267 pixels and overflows at 189 of the 191 widths. The screenshot at 144 pixels shows the phrase extending beyond the frame, instead of a short unit moving cleanly to the next line.
Another variant used a word joiner, U+2060, without adding any space character. The punctuation mark stays on the word’s line across our entire range. Yet the image then displays “transmission:”, without the visible gap required by our typographic choice. Passing the binding test is therefore not enough either: you can end up with attached punctuation whose appearance does not match the specification.
Protect the Group Without Locking the Entire Phrase
A second series examined five new variants, covering 955 layouts and three additional screenshots. First, we kept the emergency wrap rule on the paragraph and simply wrapped “transmission,” its non-breaking space, and the colon inside a text element. No extra protection was applied to this control element. Its results match those of the first emergency-wrap variant: separation occurs between 137 and 150 pixels, with no overflow. The mere presence of that wrapper therefore does not fix the issue.
In the next variant, the property disabling soft wraps applies only to that short unit; the rest of the paragraph keeps the emergency wrap mechanism. At 160 CSS pixels, the word and colon stay together, while “demain” can drop underneath. The content no longer overflows: 158 pixels for 158 available. The earlier global lock still demanded 267 pixels. Here, the difference is not an abstract decision to keep words together: it is the actual scope given to the protection in the document.
At 144 pixels, this local fix also preserves the bond, but still requires 148 pixels for 142 available. It therefore does not satisfy all three criteria at that width. We then requested a 23-pixel font size for the entire phrase, instead of 24, without changing the characters or the protected group. In this third measured case, the content fits within 142 pixels and the colon stays with the word. The screenshot shows the expected visible gap and “demain” wrapping cleanly to the next line.
This last variant thus provides a solution for our example at 144 pixels. Local protection alone was already sufficient at 160; reducing the font size was unnecessary for that first case. Conversely, narrowing the scope without reconsidering the available space was not enough for the second. The comparison separates two decisions that changing all the rules at once would have concealed: deciding what is allowed to break, and then checking how much space it actually occupies.
This does not justify automatically shrinking every heading to 23 pixels. Our variant still overflows at the narrowest widths in the sweep. We changed the requested size for the entire phrase, rather than identifying an ideal typeface for a book. The result handed over must keep those conditions attached: the reader receives a corrected case they can inspect, without receiving a promise of legibility or compatibility on configurations we did not test.
A Breaking Thin Space Does Not Predict the Outcome on Its Own
The final case calls for precision in terminology. The Unicode report classifies U+2009 among breaking spaces. That does not entitle us to claim it will necessarily separate the colon from our word in every browser or at every width. Our variant using that character shows no separation across the tested range, even though overflow still occurs at certain widths.
To test this difference in another context, we prepared two variants without the colon: the word “transmission” is followed by the space character, then “demain.” The two strings differ only in which thin space is used. The script now compares the “d” of “demain” with the final letter of “transmission”; it is not measuring an absent punctuation mark. At 210 CSS pixels, the variant with the breaking thin space moves “demain” onto the next line, with no overflow recorded.
With the narrow no-break space, that separation does not appear at any of the 191 widths in the new sweep. At 210 pixels, the group takes up 217 pixels for 208 available; the screenshot shows it overflowing the frame. The two characters that had both kept the colon attached in the first phrase are thus distinguished here by a visible consequence. We do not explain every internal choice made by the browser from this single check; we can, however, rule out the idea that the two characters are interchangeable simply because an initial image looked identical.
Hand Over a Flaw That Can Be Reproduced
To submit a fix request, you can now preserve a documented example: its character string, its HTML elements, the CSS rules involved, and the width at which the discrepancy appears. The desired outcome must be stated as well. Our proofs thus distinguish bound punctuation, a visible gap, and content that fits; none of these three checks replaces the other two.
Sources and Method
Unicode, Annex #14. https://www.unicode.org/reports/tr14/
W3C, CSS Text Module Level 3, specification draft. https://www.w3.org/TR/css-text-3/
WHATWG, HTML Standard, sections on the two line-break elements examined. https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-br-element
The initial proofs and the five additional variants are our own original exercises. The measurements and seven screenshots were genuinely produced and inspected within the stated limits. No tests on a printed version, a screen reader, another browser, or desktop publishing software are reported.
