@@ -55,8 +55,9 @@ Typographic Pseudo-elements</h2>
55
55
<h3 id="first-line-pseudo">
56
56
The ::first-line pseudo-element</h3>
57
57
58
- The <dfn>::first-line</dfn> pseudo-element describes the contents of
59
- the <a>first formatted line</a> of its <a>originating element</a> .
58
+ The <dfn>::first-line</dfn> [=pseudo-element=] represents
59
+ the contents of the [=first formatted line=]
60
+ of its [=originating element=] .
60
61
61
62
<div class="example">
62
63
The rule below means
@@ -66,77 +67,49 @@ The ::first-line pseudo-element</h3>
66
67
67
68
The selector ''p::first-line''
68
69
does not match any real document element.
69
- It does match a pseudo-element that conforming user agents
70
- will insert at the beginning of every <code> p</code> element.
70
+ It instead matches a pseudo-element
71
+ that the user agent will automatically insert
72
+ at the beginning of every <code> p</code> element.
71
73
</div>
72
74
73
75
Note: Note that the length of the first line depends on a number of factors,
74
76
including the width of the page, the font size, etc.
75
77
76
- <div class="example">
78
+ <div class="example" id="first-line-example" >
77
79
For example, given an ordinary HTML [[HTML5]] paragraph such as:
78
80
79
81
<pre>
80
- <P>This is a somewhat long HTML
81
- paragraph that will be broken into several
82
- lines. The first line will be identified
83
- by a fictional tag sequence. The other lines
84
- will be treated as ordinary lines in the
85
- paragraph.</P>
82
+ <P>This is a somewhat long HTML paragraph
83
+ that will be broken into several lines.
84
+ The first line will be styled
85
+ by the ‘::first-line’ pseudo-element.
86
+ The other lines will be treated
87
+ as ordinary lines in the paragraph.</P>
86
88
</pre>
87
89
88
- The lines might be broken as follows:
90
+ Depending on the width of the element,
91
+ its lines might be broken as follows:
89
92
90
93
<pre>
91
94
THIS IS A SOMEWHAT LONG HTML PARAGRAPH THAT
92
- will be broken into several lines. The first
93
- line will be identified by a fictional tag
94
- sequence. The other lines will be treated as
95
- ordinary lines in the paragraph.
96
- </pre>
97
-
98
- This paragraph might be “rewritten” by user agents
99
- to include a <dfn>fictional tag sequence</dfn> to represent ''::first-line'' .
100
- This <a>fictional tag sequence</a> helps to show how properties are inherited.
101
-
102
- <pre>
103
- <P><b> <P::first-line></b> This is a somewhat long HTML
104
- paragraph that <b> </P::first-line></b> will be broken into several
105
- lines. The first line will be identified
106
- by a fictional tag sequence. The other lines
107
- will be treated as ordinary lines in the
108
- paragraph.</P>
109
- </pre>
110
- </div>
111
-
112
- If a pseudo-element breaks up a real element,
113
- the desired effect can often be described by a <a>fictional tag sequence</a>
114
- that closes and then re-opens the element.
115
-
116
- <div class="example">
117
- Thus, if we mark up the previous paragraph with a <code> span</code>
118
- element encompassing the first sentence:
119
-
120
- <pre>
121
- <P><b> <SPAN class="test"></b> This is a somewhat long HTML
122
- paragraph that will be broken into several
123
- lines.<b> </SPAN></b> The first line will be identified
124
- by a fictional tag sequence. The other lines
125
- will be treated as ordinary lines in the
126
- paragraph.</P>
95
+ will be broken into several lines. The
96
+ first line will be by the ‘::first-line’
97
+ pseudo-element. The other lines will be
98
+ treated as ordinary lines in the paragraph.
127
99
</pre>
128
100
129
- the user agent could simulate start and end tags for <code> span</code>
130
- when inserting the <a>fictional tag sequence</a> for ''::first-line''
131
- to get the correct inheritance behavior.
101
+ or alternately as follows:
132
102
133
103
<pre>
134
- <P><P::first-line><b> <SPAN class="test"></b> This is a somewhat long HTML
135
- paragraph that will <b> </SPAN></b> </P::first-line><b> <SPAN class="test"></b> be broken into several
136
- lines.<b> </SPAN></b> The first line will be identified
137
- by a fictional tag sequence. The other lines
138
- will be treated as ordinary lines in the
139
- paragraph.</P>
104
+ THIS IS A SOMEWHAT LONG
105
+ HTML paragraph that will
106
+ be broken into several
107
+ lines. The first line will
108
+ be by the ‘::first-line’
109
+ pseudo-element. The other
110
+ lines will be treated as
111
+ ordinary lines in the
112
+ paragraph.
140
113
</pre>
141
114
</div>
142
115
@@ -227,6 +200,68 @@ Inheritance and the ''::first-line'' Pseudo-element</h4>
227
200
(The portion of a child element that does not occur on the first line
228
201
always inherits from the non-pseudo parent.)
229
202
203
+
204
+ <div class="example">
205
+ In the common case (of standard inherited CSS properties),
206
+ [=inheritance=] into and from a ''::first-line'' pseudo-element
207
+ can be understood by writing out a <dfn>fictional tag sequence</dfn>
208
+ to represent ''::first-line'' .
209
+ Consider the <a href="#first-line-example">earlier example</a> ;
210
+ in case of the first rendering, the fictional tag sequence would be:
211
+
212
+ <pre>
213
+ <P><strong> <p::first-line></strong> This is a somewhat long HTML paragraph
214
+ that<strong> </p::first-line></strong> will be broken into several lines.
215
+ The first line will be styled
216
+ by the ‘::first-line’ pseudo-element.
217
+ The other lines will be treated
218
+ as ordinary lines in the paragraph.</P>
219
+ </pre>
220
+
221
+ And in the case of the second rendering:
222
+
223
+ <pre>
224
+ <P><strong> <p::first-line></strong> This is a somewhat long<strong> </p::first-line></strong> HTML paragraph
225
+ that will be broken into several lines.
226
+ The first line will be styled
227
+ by the ‘::first-line’ pseudo-element.
228
+ The other lines will be treated
229
+ as ordinary lines in the paragraph.</P>
230
+ </pre>
231
+ </div>
232
+
233
+
234
+ <div class="example">
235
+ If a pseudo-element breaks up a real element,
236
+ the effect can often be described
237
+ by a <a>fictional tag sequence</a>
238
+ that closes and then re-opens the element.
239
+ Suppose we mark up the earlier example
240
+ with a <code> span</code> element encompassing the first sentence:
241
+
242
+ <pre>
243
+ <P><strong> <span></strong> This is a somewhat long HTML paragraph
244
+ that will be broken into several lines.<strong> </span></strong>
245
+ The first line will be styled
246
+ by the ‘::first-line’ pseudo-element.
247
+ The other lines will be treated
248
+ as ordinary lines in the paragraph.</P>
249
+ </pre>
250
+
251
+ The effect of the first rendering
252
+ would be similar to the following [=fictional tag sequence=] :
253
+
254
+ <pre>
255
+ <P<P><strong> <p::first-line>><span></strong> This is a somewhat long HTML paragraph
256
+ that<strong> </span></P><p::first-line><span></strong> will be broken into several lines.<strong> </span></strong>
257
+ The first line will be styled
258
+ by the ‘::first-line’ pseudo-element.
259
+ The other lines will be treated
260
+ as ordinary lines in the paragraph.</P>
261
+ </pre>
262
+ </div>
263
+
264
+
230
265
<h3 id="first-letter-pseudo">
231
266
The ::first-letter pseudo-element</h3>
232
267
0 commit comments