Skip to content

Commit 933618c

Browse files
committed
[css-pseudo-4] Remove terrible outdated examples. #4392
1 parent 15d5a1c commit 933618c

File tree

1 file changed

+12
-77
lines changed

1 file changed

+12
-77
lines changed

css-pseudo-4/Overview.bs

Lines changed: 12 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,8 @@ Inheritance and Box Tree Structure of the ''::first-letter'' Pseudo-element</h4>
379379
380380
<pre>
381381
&lt;div&gt;
382-
&lt;p&gt;The first text.
382+
&lt;p&gt;&lt;span&gt;The first few words&lt;/span>
383+
and the rest of the paragraph.
383384
&lt;/div&gt;
384385
</pre>
385386
@@ -389,7 +390,8 @@ Inheritance and Box Tree Structure of the ''::first-letter'' Pseudo-element</h4>
389390
390391
<pre>
391392
&lt;div&gt;
392-
&lt;p&gt;&lt;div::first-letter&gt;&lt;p::first-letter&gt;T&lt;/&hellip;&gt;&lt;/&hellip;&gt;he first text.
393+
&lt;p&gt;&lt;span&gt;<strong>&lt;div::first-letter&gt;&lt;p::first-letter&gt;</strong>T<strong>&lt;/&hellip;&gt;&lt;/&hellip;&gt;</strong>he first few words&lt;/span>
394+
and the rest of the paragraph.
393395
&lt;/div&gt;
394396
</pre>
395397
</div>
@@ -436,82 +438,15 @@ Styling the ''::first-letter'' Pseudo-element</h4>
436438
what [=first-letter text=] is represented by that ''::first-letter''.
437439
438440
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),
444447
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-
&lt;p&gt;&lt;span&gt;Het hemelsche&lt;/span&gt; gerecht heeft zich ten lange lesten&lt;br&gt;
460-
Erbarremt over my en mijn benaeuwde vesten&lt;br&gt;
461-
En arme burgery, en op mijn volcx gebed&lt;br&gt;
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-
&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"&gt;
474-
&lt;HTML&gt;
475-
&lt;HEAD&gt;
476-
&lt;TITLE&gt;Drop cap initial letter&lt;/TITLE&gt;
477-
&lt;STYLE type="text/css"&gt;
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-
&lt;/STYLE&gt;
482-
&lt;/HEAD&gt;
483-
&lt;BODY&gt;
484-
&lt;P&gt;&lt;SPAN&gt;The first&lt;/SPAN&gt; few words of an article
485-
in The Economist.&lt;/P&gt;
486-
&lt;/BODY&gt;
487-
&lt;/HTML&gt;
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-
&lt;P&gt;
501-
&lt;SPAN&gt;
502-
&lt;P::first-letter&gt;
503-
T
504-
&lt;/P::first-letter&gt;he first
505-
&lt;/SPAN&gt;
506-
few words of an article in the Economist.
507-
&lt;/P&gt;
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.
515450
516451
<h2 id="highlight-pseudos">
517452
Highlight Pseudo-elements</h2>

0 commit comments

Comments
 (0)