Skip to content

Commit a097545

Browse files
committed
[css-text-3] Add example of hanging punctuation and right alignment
1 parent 36991b6 commit a097545

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

css-text-3/Overview.bs

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1193,7 +1193,31 @@ Characters and Letters</h3>
11931193

11941194
</ol>
11951195

1196-
Issue: Add example of hanging white space + same example right-aligned.
1196+
<div class=example>
1197+
This example illustrates the consequence of [=hanging=] white space
1198+
at the end of the line
1199+
on text alignement.
1200+
<pre><code class=lang-css>
1201+
p {
1202+
white-space: pre-wrap;
1203+
text-align: end;
1204+
width: 20ch;
1205+
border: solid 1px;
1206+
}</code></pre>
1207+
<pre><code class=lang-markup>
1208+
&lt;p>Lorem ipsum &lt;/p>
1209+
</code></pre>
1210+
1211+
As the preserved spaces at the end of the line must [=hang=],
1212+
they are not considered when placing the rest of the line during text alignment.
1213+
When aligning towards the end,
1214+
this means any such spaces will overflow,
1215+
and will not prevent the rest of the line's content from being flush with the edge of the line.
1216+
The sample above would therefore be rendered as follows:
1217+
<pre class=output style="width: 20ch; border: solid 1px; text-align: end;">
1218+
Lorem ipsum
1219+
</pre>
1220+
</div>
11971221

11981222
<p>White space that was not removed or collapsed during the white space
11991223
processing steps is called <dfn>preserved</dfn> white space.</p>

0 commit comments

Comments
 (0)