You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: css-pseudo-4/Overview.bs
+12-77Lines changed: 12 additions & 77 deletions
Original file line number
Diff line number
Diff line change
@@ -379,7 +379,8 @@ Inheritance and Box Tree Structure of the ''::first-letter'' Pseudo-element</h4>
379
379
380
380
<pre>
381
381
<div>
382
-
<p>The first text.
382
+
<p><span>The first few words</span>
383
+
and the rest of the paragraph.
383
384
</div>
384
385
</pre>
385
386
@@ -389,7 +390,8 @@ Inheritance and Box Tree Structure of the ''::first-letter'' Pseudo-element</h4>
389
390
390
391
<pre>
391
392
<div>
392
-
<p><div::first-letter><p::first-letter>T</…></…>he first text.
393
+
<p><span><strong><div::first-letter><p::first-letter></strong>T<strong></…></…></strong>he first few words</span>
394
+
and the rest of the paragraph.
393
395
</div>
394
396
</pre>
395
397
</div>
@@ -436,82 +438,15 @@ Styling the ''::first-letter'' Pseudo-element</h4>
436
438
what [=first-letter text=] is represented by that ''::first-letter''.
437
439
438
440
Note: In previous levels of CSS,
439
-
User Agents were allowed to choose a line height, width and height based on the shape of the letter,
440
-
approximate font sizes,
441
-
or to take the glyph outline into account when formatting.
442
-
This possibility has been intentionally removed,
443
-
as it proved to be a poor solution for the intended use case (Drop Caps),
441
+
User Agents were allowed to choose a line height, width, and height
442
+
based on the shape of the letter,
443
+
to approximate font sizes;
444
+
and to take the glyph outline into account when performing layout.
445
+
The possibility of such loosely-defined magic has been intentionally removed,
446
+
as it proved to be a poor solution for the intended use case (drop caps and raised caps),
444
447
yet caused interoperability problems.
445
-
446
-
<div class="example">
447
-
Example:
448
-
This CSS and HTML example shows a possible rendering of an initial cap.
449
-
Note that the fictional start tag of the first letter
450
-
is inside the <span>span</span>,
451
-
and thus the font weight of the first letter is normal,
452
-
not bold as the <span>span</span>:
453
-
454
-
<pre>
455
-
p { line-height: 1.1 }
456
-
p::first-letter { font-size: 3em; font-weight: normal }
457
-
span { font-weight: bold }
458
-
...
459
-
<p><span>Het hemelsche</span> gerecht heeft zich ten lange lesten<br>
460
-
Erbarremt over my en mijn benaeuwde vesten<br>
461
-
En arme burgery, en op mijn volcx gebed<br>
462
-
En dagelix geschrey de bange stad ontzet.
463
-
</pre>
464
-
465
-
<div class="figure">
466
-
<img alt="Image illustrating the ::first-letter pseudo-element" src="images/initial-cap.png">
467
-
</div>
468
-
</div>
469
-
470
-
<div class="example">
471
-
The following CSS will make a drop cap initial letter span about two lines:
472
-
<pre>
473
-
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
474
-
<HTML>
475
-
<HEAD>
476
-
<TITLE>Drop cap initial letter</TITLE>
477
-
<STYLE type="text/css">
478
-
P { font-size: 12pt; line-height: 1.2 }
479
-
P::first-letter { font-size: 200%; font-weight: bold; float: left }
480
-
SPAN { text-transform: uppercase }
481
-
</STYLE>
482
-
</HEAD>
483
-
<BODY>
484
-
<P><SPAN>The first</SPAN> few words of an article
485
-
in The Economist.</P>
486
-
</BODY>
487
-
</HTML>
488
-
</pre>
489
-
490
-
This example might be formatted as follows:
491
-
492
-
<div class="figure">
493
-
<img alt="Image illustrating the combined effect of the ::first-letter
494
-
and ::first-line pseudo-elements" src="images/first-letter.gif">
495
-
</div>
496
-
497
-
The <a>fictional tag sequence</a> is:
498
-
499
-
<pre>
500
-
<P>
501
-
<SPAN>
502
-
<P::first-letter>
503
-
T
504
-
</P::first-letter>he first
505
-
</SPAN>
506
-
few words of an article in the Economist.
507
-
</P>
508
-
</pre>
509
-
510
-
Note that the ''::first-letter'' pseudo-element tags abut the
511
-
content (i.e., the initial character), while the ::first-line
512
-
pseudo-element start tag is inserted right after the start tag of the
513
-
block element.
514
-
</div>
448
+
See 'initial-letter' in [[CSS-INLINE-3]]
449
+
for explicitly handling drop caps and raised caps.
0 commit comments