@@ -117,40 +117,51 @@ The ::first-line pseudo-element</h3>
117
117
Finding the First Formatted Line</h4>
118
118
119
119
In CSS, the ''::first-line'' pseudo-element
120
- can only have an effect when attached to a <a>block container</a> .
121
- The <dfn export>first formatted line</dfn> of an element
122
- must occur inside a block-level descendant in the same flow
123
- (i.e., a block-level descendant that is not out-of-flow due to floating or positioning).
124
-
125
- <div class="example">
126
- For example, the first line of the <code> DIV</code> in <code> <DIV><P>This line...</P></DIV></code>
127
- is the first line of the <code> P</code>
128
- (assuming that both <code> P</code> and <code> DIV</code> are blocks).
129
- </div>
130
-
131
- The first line of a [=block container=] which does not participate in a [=block formatting context=]
132
- (and likewise the first line of a [=table caption=] )
120
+ can only have an effect when attached to a <a>block container</a> :
121
+
122
+ * The <dfn export>first formatted line</dfn> of
123
+ a [=block container=] that establishes an [=inline formatting context=]
124
+ contains the [=inline-level=] content of its first [=line box=] .
125
+ * The [=first formatted line=] of
126
+ a [=block container=] or [=multi-column container=]
127
+ that contains [=block-level=] content
128
+ (and is not a [=table wrapper box=] )
129
+ is the [=first formatted line=] of
130
+ its first [=in-flow=] [=block-level=] child.
131
+ If no such line exists,
132
+ it has no [=first formatted line=] .
133
+
134
+ Note: The [=first formatted line=] can be an empty line.
135
+ For example, the first line of the <code> p</code> in
136
+ <code> <p><br>First…</code>
137
+ doesn't contain any letters.
138
+ Thus the word “First” is not on the first formatted line,
139
+ and will not be affected by ''p::first-line'' .
140
+
141
+ Note: The first line of a [=block container=]
142
+ that does not participate in a [=block formatting context=]
133
143
cannot be the first formatted line of an ancestor element.
134
144
Thus, in <code> <DIV><P STYLE="display: inline-block">Hello<BR>Goodbye</P> etcetera</DIV></code>
135
- the first formatted line of the <code> DIV</code> is not the line "Hello".
145
+ the first formatted line of the <code> DIV</code> is not the line “Hello”,
146
+ but rather the (otherwise empty) line that contains that entire inline block.
136
147
137
- Note: Note that the first line of the <code> p</code> in this fragment:
138
- <code> <p><br>First...</code>
139
- doesn't contain any letters (assuming the default style for <code> br</code> ).
140
- The word "First" is not on the first formatted line.
141
-
142
- A user agent must act as if the fictional start tags of a ''::first-line'' pseudo-element
143
- were nested just inside the innermost enclosing block-level element.
148
+ When a [=first formatted line=] is represented
149
+ by multiple ''::first-line'' pseudo-elements,
150
+ they are nested in the same order as their [=originating elements=] .
144
151
145
152
<div class="example">
146
- For example, the <a>fictional tag sequence</a> for
153
+ Consider the following markup:
147
154
<pre>
148
155
<DIV>
149
156
<P>First paragraph</P>
150
157
<P>Second paragraph</P>
151
158
</DIV>
152
159
</pre>
153
- is
160
+
161
+ If we assume a [=fictional tag sequence=] to represent
162
+ the elements’ ''::first-line'' pseudo elements,
163
+ it would be something like:
164
+
154
165
<pre>
155
166
<DIV>
156
167
<P><DIV::first-line><P::first-line>First paragraph</P::first-line></DIV::first-line></P>
0 commit comments