-
-
Notifications
You must be signed in to change notification settings - Fork 72
/
Copy pathcss-text-wrapping.html
745 lines (660 loc) · 26.1 KB
/
css-text-wrapping.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CSS Text Wrapping Properties Guide</title>
<style>
* {
box-sizing: border-box;
}
body {
font-family: Helvetica, Arial, sans-serif;
line-height: 1.6;
max-width: 1200px;
margin: 0 auto;
padding: 20px;
color: #333;
}
h1, h2, h3 {
margin-top: 1.5em;
margin-bottom: 0.5em;
}
h1 {
border-bottom: 2px solid #333;
padding-bottom: 10px;
}
p {
margin-bottom: 1em;
}
.property-section {
margin-bottom: 40px;
padding: 20px;
border-radius: 5px;
background-color: #f8f8f8;
}
.demo-container {
display: flex;
flex-wrap: wrap;
gap: 20px;
margin: 20px 0;
}
.demo-box {
width: 280px;
height: 200px;
padding: 15px;
border: 1px solid #ddd;
background-color: white;
overflow: auto;
position: relative;
}
.demo-label {
font-weight: bold;
margin-bottom: 10px;
padding-bottom: 5px;
border-bottom: 1px dashed #ccc;
}
.demo-text {
font-size: 14px;
}
.long-word {
color: #d35400;
}
.code {
font-family: monospace;
background-color: #f1f1f1;
padding: 2px 4px;
border-radius: 3px;
}
table {
width: 100%;
border-collapse: collapse;
margin: 20px 0;
}
th, td {
border: 1px solid #ddd;
padding: 8px 12px;
text-align: left;
}
th {
background-color: #f2f2f2;
}
tr:nth-child(even) {
background-color: #f9f9f9;
}
.browser-support {
margin-top: 15px;
}
.support-good {
color: #27ae60;
}
.support-partial {
color: #f39c12;
}
.support-poor {
color: #e74c3c;
}
.controls {
margin: 15px 0;
}
input, textarea {
padding: 8px;
border: 1px solid #ddd;
border-radius: 4px;
font-size: 16px;
font-family: Helvetica, Arial, sans-serif;
width: 100%;
max-width: 500px;
}
button {
padding: 8px 16px;
background-color: #4a90e2;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
font-size: 16px;
margin-top: 10px;
}
button:hover {
background-color: #3a7bc8;
}
.toc {
background-color: #f8f8f8;
padding: 15px;
border-radius: 5px;
margin-bottom: 30px;
}
.toc ul {
margin: 0;
padding-left: 20px;
}
.toc li {
margin-bottom: 5px;
}
.note {
background-color: #e7f5ff;
padding: 10px 15px;
border-left: 4px solid #4a90e2;
margin: 15px 0;
}
.warning {
background-color: #fff7e6;
padding: 10px 15px;
border-left: 4px solid #f39c12;
margin: 15px 0;
}
</style>
</head>
<body>
<h1>CSS Text Wrapping Properties Guide</h1>
<p><strong>WARNING:</strong> This guide was <a href="https://claude.ai/share/909d9faf-2667-405e-9cc9-82f1d860f517">written by an LLM</a> and has not been fact-checked - it may include errors.</p>
<div class="toc">
<h2>Table of contents</h2>
<ul>
<li><a href="#word-wrap">word-wrap / overflow-wrap</a></li>
<li><a href="#word-break">word-break</a></li>
<li><a href="#white-space">white-space</a></li>
<li><a href="#text-overflow">text-overflow</a></li>
<li><a href="#hyphens">hyphens</a></li>
<li><a href="#line-break">line-break</a></li>
<li><a href="#text-wrap">text-wrap</a></li>
</ul>
</div>
<p>This guide demonstrates all CSS properties that control text wrapping behavior with examples and browser compatibility information. Text wrapping is how browsers handle the flow of text when it reaches the edge of its containing element.</p>
<section id="word-wrap" class="property-section">
<h2>Word-wrap / overflow-wrap property</h2>
<p><span class="code">word-wrap</span> (now also called <span class="code">overflow-wrap</span>) specifies whether the browser should break long words when they overflow their container.</p>
<div class="demo-container">
<div class="demo-box">
<div class="demo-label">overflow-wrap: normal (default)</div>
<div class="demo-text" style="overflow-wrap: normal;">
This is a regular sentence with the <span class="long-word">supercalifragilisticexpialidocioussupercalifragilisticexpialidocious</span> word that will overflow its container when using normal wrapping.
</div>
<div class="browser-support">
<strong>Browser support:</strong> <span class="support-good">Excellent across all major browsers</span>
</div>
</div>
<div class="demo-box">
<div class="demo-label">overflow-wrap: break-word</div>
<div class="demo-text" style="overflow-wrap: break-word;">
This is a regular sentence with the <span class="long-word">supercalifragilisticexpialidocioussupercalifragilisticexpialidocious</span> word that will break at arbitrary points to prevent overflow.
</div>
<div class="browser-support">
<strong>Browser support:</strong> <span class="support-good">Excellent across all major browsers</span>
</div>
</div>
<div class="demo-box">
<div class="demo-label">overflow-wrap: anywhere</div>
<div class="demo-text" style="overflow-wrap: anywhere;">
This is a regular sentence with the <span class="long-word">supercalifragilisticexpialidocioussupercalifragilisticexpialidocious</span> word that will break even between characters to optimize line filling.
</div>
<div class="browser-support">
<strong>Browser support:</strong> <span class="support-partial">Good in modern browsers, IE not supported</span>
</div>
</div>
</div>
<table>
<tr>
<th>Value</th>
<th>Description</th>
</tr>
<tr>
<td>normal</td>
<td>Words break only at allowed break points (like spaces or hyphens)</td>
</tr>
<tr>
<td>break-word</td>
<td>Words will break at arbitrary points if they're too long for their container</td>
</tr>
<tr>
<td>anywhere</td>
<td>Like break-word, but also creates soft wrap opportunities for better line filling</td>
</tr>
</table>
<div class="note">
<p><strong>Note:</strong> <span class="code">word-wrap</span> is the original property name and <span class="code">overflow-wrap</span> is the modern standard name for the same property. For best compatibility, you can use both in your CSS.</p>
</div>
</section>
<section id="word-break" class="property-section">
<h2>Word-break property</h2>
<p><span class="code">word-break</span> specifies how word breaks should occur, particularly for non-western languages.</p>
<div class="demo-container">
<div class="demo-box">
<div class="demo-label">word-break: normal (default)</div>
<div class="demo-text" style="word-break: normal;">
This is a regular sentence with the <span class="long-word">supercalifragilisticexpialidocioussupercalifragilisticexpialidocious</span> word using normal breaking rules. Chinese text like 这是一些中文文本示例 follows language-specific rules.
</div>
<div class="browser-support">
<strong>Browser support:</strong> <span class="support-good">Excellent across all major browsers</span>
</div>
</div>
<div class="demo-box">
<div class="demo-label">word-break: break-all</div>
<div class="demo-text" style="word-break: break-all;">
This is a regular sentence with the <span class="long-word">supercalifragilisticexpialidocioussupercalifragilisticexpialidocious</span> word that will break at any character. Even regular words break between any characters.
</div>
<div class="browser-support">
<strong>Browser support:</strong> <span class="support-good">Excellent across all major browsers</span>
</div>
</div>
<div class="demo-box">
<div class="demo-label">word-break: keep-all</div>
<div class="demo-text" style="word-break: keep-all;">
This is a regular sentence with the <span class="long-word">supercalifragilisticexpialidocioussupercalifragilisticexpialidocious</span> word. Chinese text like 这是一些中文文本示例 won't break between characters.
</div>
<div class="browser-support">
<strong>Browser support:</strong> <span class="support-good">Good in modern browsers, partial in older ones</span>
</div>
</div>
<div class="demo-box">
<div class="demo-label">word-break: break-word (deprecated)</div>
<div class="demo-text" style="word-break: break-word;">
This is a regular sentence with the <span class="long-word">supercalifragilisticexpialidocioussupercalifragilisticexpialidocious</span> word showing similar behavior to overflow-wrap: break-word, but is now deprecated.
</div>
<div class="browser-support">
<strong>Browser support:</strong> <span class="support-partial">Varies, deprecated in favor of overflow-wrap</span>
</div>
</div>
</div>
<table>
<tr>
<th>Value</th>
<th>Description</th>
</tr>
<tr>
<td>normal</td>
<td>Default breaking rules for each language</td>
</tr>
<tr>
<td>break-all</td>
<td>Words break at any character to prevent overflow</td>
</tr>
<tr>
<td>keep-all</td>
<td>Prevents breaks for Chinese, Japanese, and Korean text</td>
</tr>
<tr>
<td>break-word</td>
<td>Deprecated, similar to overflow-wrap: break-word</td>
</tr>
</table>
<div class="warning">
<p><strong>Important:</strong> The <span class="code">word-break: break-word</span> value is now deprecated and behaves similarly to <span class="code">overflow-wrap: break-word</span>. Use overflow-wrap for better compatibility.</p>
</div>
</section>
<section id="white-space" class="property-section">
<h2>White-space property</h2>
<p><span class="code">white-space</span> controls how whitespace (spaces, tabs, newlines) is handled within an element.</p>
<div class="demo-container">
<div class="demo-box">
<div class="demo-label">white-space: normal (default)</div>
<div class="demo-text" style="white-space: normal;">
This text has multiple spaces
and
line
breaks, but they are collapsed into single spaces, and text wraps as needed.
</div>
<div class="browser-support">
<strong>Browser support:</strong> <span class="support-good">Excellent across all major browsers</span>
</div>
</div>
<div class="demo-box">
<div class="demo-label">white-space: nowrap</div>
<div class="demo-text" style="white-space: nowrap;">
This text will appear in a single line no matter how long it is and won't wrap to the next line until a <br> tag or explicit line break is encountered.
</div>
<div class="browser-support">
<strong>Browser support:</strong> <span class="support-good">Excellent across all major browsers</span>
</div>
</div>
<div class="demo-box">
<div class="demo-label">white-space: pre</div>
<div class="demo-text" style="white-space: pre;">
This text has multiple spaces
and
line
breaks, and they are all preserved exactly as written. No wrapping occurs.
</div>
<div class="browser-support">
<strong>Browser support:</strong> <span class="support-good">Excellent across all major browsers</span>
</div>
</div>
<div class="demo-box">
<div class="demo-label">white-space: pre-wrap</div>
<div class="demo-text" style="white-space: pre-wrap;">
This text has multiple spaces
and
line
breaks, they are preserved, and text will also wrap at the end of lines when needed.
</div>
<div class="browser-support">
<strong>Browser support:</strong> <span class="support-good">Excellent across all major browsers</span>
</div>
</div>
<div class="demo-box">
<div class="demo-label">white-space: pre-line</div>
<div class="demo-text" style="white-space: pre-line;">
This text has multiple spaces
and
line
breaks, spaces are collapsed, but line breaks are preserved, and text wraps.
</div>
<div class="browser-support">
<strong>Browser support:</strong> <span class="support-good">Excellent across all major browsers</span>
</div>
</div>
<div class="demo-box">
<div class="demo-label">white-space: break-spaces</div>
<div class="demo-text" style="white-space: break-spaces;">
This text has multiple spaces
and
line
breaks, like pre-wrap but spaces at the end of lines and between words won't collapse.
</div>
<div class="browser-support">
<strong>Browser support:</strong> <span class="support-partial">Good in modern browsers, not in IE</span>
</div>
</div>
</div>
<table>
<tr>
<th>Value</th>
<th>Whitespace collapse</th>
<th>Line breaks preserved</th>
<th>Text wrapping</th>
</tr>
<tr>
<td>normal</td>
<td>Yes</td>
<td>No</td>
<td>Yes</td>
</tr>
<tr>
<td>nowrap</td>
<td>Yes</td>
<td>No</td>
<td>No</td>
</tr>
<tr>
<td>pre</td>
<td>No</td>
<td>Yes</td>
<td>No</td>
</tr>
<tr>
<td>pre-wrap</td>
<td>No</td>
<td>Yes</td>
<td>Yes</td>
</tr>
<tr>
<td>pre-line</td>
<td>Yes</td>
<td>Yes</td>
<td>Yes</td>
</tr>
<tr>
<td>break-spaces</td>
<td>No</td>
<td>Yes</td>
<td>Yes, with preserved spaces</td>
</tr>
</table>
</section>
<section id="text-overflow" class="property-section">
<h2>Text-overflow property</h2>
<p><span class="code">text-overflow</span> specifies how overflowed content is signaled to users. Note that this requires <span class="code">overflow: hidden</span> and typically <span class="code">white-space: nowrap</span> to work properly.</p>
<div class="demo-container">
<div class="demo-box">
<div class="demo-label">text-overflow: clip (default)</div>
<div class="demo-text" style="white-space: nowrap; overflow: hidden; text-overflow: clip;">
This is a very long text that will be clipped at the boundary of its container box without any special indicator.
</div>
<div class="browser-support">
<strong>Browser support:</strong> <span class="support-good">Excellent across all major browsers</span>
</div>
</div>
<div class="demo-box">
<div class="demo-label">text-overflow: ellipsis</div>
<div class="demo-text" style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">
This is a very long text that will be truncated with an ellipsis (…) indicating there is more content.
</div>
<div class="browser-support">
<strong>Browser support:</strong> <span class="support-good">Excellent across all major browsers</span>
</div>
</div>
<div class="demo-box">
<div class="demo-label">text-overflow: "→"</div>
<div class="demo-text" style="white-space: nowrap; overflow: hidden; text-overflow: '→';">
This is a very long text that will be truncated with a custom string (in this case an arrow) indicating more content.
</div>
<div class="browser-support">
<strong>Browser support:</strong> <span class="support-partial">Limited, works in Firefox, not in Chrome or Safari</span>
</div>
</div>
</div>
<table>
<tr>
<th>Value</th>
<th>Description</th>
</tr>
<tr>
<td>clip</td>
<td>Default. The text is clipped and not accessible</td>
</tr>
<tr>
<td>ellipsis</td>
<td>Renders an ellipsis ("…") to represent clipped text</td>
</tr>
<tr>
<td>string</td>
<td>Renders the given string to represent clipped text (limited support)</td>
</tr>
</table>
<div class="note">
<p><strong>Note:</strong> For <span class="code">text-overflow</span> to have any effect, the element must have <span class="code">overflow</span> set to something other than <span class="code">visible</span>, and the content must be constrained in the inline direction (typically by using <span class="code">white-space: nowrap</span>).</p>
</div>
</section>
<section id="hyphens" class="property-section">
<h2>Hyphens property</h2>
<p><span class="code">hyphens</span> controls how words break with hyphens when they reach the end of a line.</p>
<div class="demo-container">
<div class="demo-box">
<div class="demo-label">hyphens: none</div>
<div class="demo-text" style="hyphens: none;">
This demonstration contains some extraordinarily long vocabulary specifically to showcase hyphenation demonstration capabilities of cascading style sheets.
</div>
<div class="browser-support">
<strong>Browser support:</strong> <span class="support-good">Good in modern browsers, requires prefixes in some</span>
</div>
</div>
<div class="demo-box">
<div class="demo-label">hyphens: auto</div>
<div class="demo-text" style="hyphens: auto;" lang="en">
This demonstration contains some extraordinarily long vocabulary specifically to showcase hyphenation demonstration capabilities of cascading style sheets.
</div>
<div class="browser-support">
<strong>Browser support:</strong> <span class="support-partial">Varies across browsers, requires lang attribute</span>
</div>
</div>
<div class="demo-box">
<div class="demo-label">hyphens: manual</div>
<div class="demo-text" style="hyphens: manual;">
This demon­stration contains some extra­ordinarily long voca­bulary speci­fically to show­case hyphen­ation demon­stration capa­bilities.
</div>
<div class="browser-support">
<strong>Browser support:</strong> <span class="support-good">Good in most modern browsers</span>
</div>
</div>
</div>
<table>
<tr>
<th>Value</th>
<th>Description</th>
</tr>
<tr>
<td>none</td>
<td>Words won't break at line ends, even if characters like hyphens suggest breakpoints</td>
</tr>
<tr>
<td>manual</td>
<td>Words only break at suggested break points (using &shy; or soft hyphens)</td>
</tr>
<tr>
<td>auto</td>
<td>Browser automatically determines hyphenation points based on language rules</td>
</tr>
</table>
<div class="note">
<p><strong>Note:</strong> For <span class="code">hyphens: auto</span> to work properly, the content must have a valid <span class="code">lang</span> attribute set (e.g., <span class="code">lang="en"</span>). Browser support and quality of automatic hyphenation varies.</p>
</div>
</section>
<section id="line-break" class="property-section">
<h2>Line-break property</h2>
<p><span class="code">line-break</span> specifies how to break lines of Chinese, Japanese, or Korean (CJK) text when working with punctuation and symbols.</p>
<div class="demo-container">
<div class="demo-box">
<div class="demo-label">line-break: auto (default)</div>
<div class="demo-text" style="line-break: auto;">
日本語の例文です。句読点や括弧などの記号も含まれています(例えば、これは括弧内のテキストです)。終わりに句点があります。
</div>
<div class="browser-support">
<strong>Browser support:</strong> <span class="support-partial">Good in modern browsers, varies in older ones</span>
</div>
</div>
<div class="demo-box">
<div class="demo-label">line-break: loose</div>
<div class="demo-text" style="line-break: loose;">
日本語の例文です。句読点や括弧などの記号も含まれています(例えば、これは括弧内のテキストです)。終わりに句点があります。
</div>
<div class="browser-support">
<strong>Browser support:</strong> <span class="support-partial">Varies across browsers</span>
</div>
</div>
<div class="demo-box">
<div class="demo-label">line-break: normal</div>
<div class="demo-text" style="line-break: normal;">
日本語の例文です。句読点や括弧などの記号も含まれています(例えば、これは括弧内のテキストです)。終わりに句点があります。
</div>
<div class="browser-support">
<strong>Browser support:</strong> <span class="support-partial">Varies across browsers</span>
</div>
</div>
<div class="demo-box">
<div class="demo-label">line-break: strict</div>
<div class="demo-text" style="line-break: strict;">
日本語の例文です。句読点や括弧などの記号も含まれています(例えば、これは括弧内のテキストです)。終わりに句点があります。
</div>
<div class="browser-support">
<strong>Browser support:</strong> <span class="support-partial">Varies across browsers</span>
</div>
</div>
<div class="demo-box">
<div class="demo-label">line-break: anywhere</div>
<div class="demo-text" style="line-break: anywhere;">
日本語の例文です。句読点や括弧などの記号も含まれています(例えば、これは括弧内のテキストです)。終わりに句点があります。
</div>
<div class="browser-support">
<strong>Browser support:</strong> <span class="support-partial">Limited, newer property value</span>
</div>
</div>
</div>
<table>
<tr>
<th>Value</th>
<th>Description</th>
</tr>
<tr>
<td>auto</td>
<td>Default - uses the default line breaking rules</td>
</tr>
<tr>
<td>loose</td>
<td>Relaxed line breaking rules, allows more breaks with CJK punctuation</td>
</tr>
<tr>
<td>normal</td>
<td>Standard line breaking rules</td>
</tr>
<tr>
<td>strict</td>
<td>Stricter line breaking rules, fewer breaks with CJK punctuation</td>
</tr>
<tr>
<td>anywhere</td>
<td>Breaks lines at any character</td>
</tr>
</table>
<div class="note">
<p><strong>Note:</strong> The <span class="code">line-break</span> property is primarily designed for CJK text and may have minimal effect on non-CJK text.</p>
</div>
</section>
<section id="text-wrap" class="property-section">
<h2>Text-wrap property</h2>
<p><span class="code">text-wrap</span> is a newer CSS property that allows for more control over text wrapping behavior.</p>
<div class="demo-container">
<div class="demo-box">
<div class="demo-label">text-wrap: wrap (default)</div>
<div class="demo-text" style="text-wrap: wrap;">
This is the default wrapping behavior where text wraps according to the available space in the container.
</div>
<div class="browser-support">
<strong>Browser support:</strong> <span class="support-partial">New property, limited support</span>
</div>
</div>
<div class="demo-box">
<div class="demo-label">text-wrap: nowrap</div>
<div class="demo-text" style="text-wrap: nowrap;">
This text will not wrap to the next line, similar to white-space: nowrap but specifically for wrapping behavior.
</div>
<div class="browser-support">
<strong>Browser support:</strong> <span class="support-partial">New property, limited support</span>
</div>
</div>
<div class="demo-box">
<div class="demo-label">text-wrap: balance</div>
<div class="demo-text" style="text-wrap: balance;">
This property attempts to balance the amount of text on each line for more visually pleasing line breaks, especially useful for headings.
</div>
<div class="browser-support">
<strong>Browser support:</strong> <span class="support-partial">Very limited, Chrome and Firefox only</span>
</div>
</div>
<div class="demo-box">
<div class="demo-label">text-wrap: pretty</div>
<div class="demo-text" style="text-wrap: pretty;">
Similar to balance, but with less aggressive balancing. Aims to prevent single words on the last line (widows).
</div>
<div class="browser-support">
<strong>Browser support:</strong> <span class="support-partial">Very limited, newest property value</span>
</div>
</div>
</div>
<table>
<tr>
<th>Value</th>
<th>Description</th>
</tr>
<tr>
<td>wrap</td>
<td>Default wrapping behavior</td>
</tr>
<tr>
<td>nowrap</td>
<td>Prevents text from wrapping</td>
</tr>
<tr>
<td>balance</td>
<td>Attempts to balance the amount of text on each line</td>
</tr>
<tr>
<td>pretty</td>
<td>Less aggressive than balance, prevents single words on last line</td>
</tr>
</table>
<div class="warning">
<p><strong>Important:</strong> <span class="code">text-wrap</span> is a newer CSS property with limited browser support. Always use fallbacks when implementing it in production.</p>
</div>
</section>
<!-- Interactive playground section removed as requested -->