Skip to content

Commit fb8d9b0

Browse files
author
dauwhe
committed
[css-inline] rewrite section on alignment of replaced content
1 parent aa292e3 commit fb8d9b0

2 files changed

Lines changed: 37 additions & 63 deletions

File tree

css-inline/Overview.bs

Lines changed: 19 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Link Defaults: css-fonts-3 (property) font-family
2626

2727
<h2>Line Heights and Baseline Alignment</h2>
2828

29-
<p class="issue">This section is being rewritten. Refer to <a href="http://www.w3.org/TR/CSS21/visudet.html#line-height">section 10.8</a> of [[CSS21]] for the normative CSS definition or the <a href="http://www.w3.org/TR/2002/WD-css3-linebox-20020515/">2002 Working Draft</a> if you want pretty pictures. (But ignore the old text, half of it's wrong.)</p>
29+
<p class="issue">This section is being rewritten. Refer to <a href="http://www.w3.org/TR/CSS21/visudet.html#line-height">section 10.8</a> of [[CSS21]] for the normative CSS definition or the <a href="http://www.w3.org/TR/2002/WD-css3-linebox-20020515/">2002 Working Draft</a> if you want pretty pictures. (But ignore the old text, half of it's wrong. We're not specifying which half, that's to be determined.)</p>
3030

3131

3232

@@ -122,34 +122,24 @@ The alignment constraints depend on the script used. In Japanese vertical writin
122122

123123
<h3 id="selecting-drop-initials">Selecting Initial Letters</h3>
124124

125-
Initial letters are typically a single letter, which can be selected by the <code>::first-letter</code> pseudo-element, as defined in [[SELECT]]. Authors who need more control over which characters are included in an initial letter can also apply the 'initial-letter' property to the first inline child of a block container.
126-
127-
128-
129-
130-
Only the following properties can be applied to the <code>::first-letter</code> pseudo-elements:
131-
132-
<ul>
133-
<li>font properties</li>
134-
<li>color properties</li>
135-
<li>background properties</li>
136-
<li>text decoration properties</li>
137-
<li>baseline alignment properties (only if 'float' is ''none'')</li>
138-
<li>'text-transform'</li>
139-
<li>'letter-spacing'</li>
140-
<li>'line-height' (may be ignored depending on the block line-stacking strategy)</li>
141-
<li>margin properties</li>
142-
<li>padding properties</li>
143-
<li>border properties</li>
144-
<li>'float'</li>
145-
<li>text-shadow</li>
146-
<li>'clear'</li>
147-
<li>'initial-letter'</li>
148-
<li>'initial-letter-align'</li>
149-
</ul>
150-
125+
Initial letters are typically a single letter, which can be selected by the <code>::first-letter</code> pseudo-element, as defined in [[SELECT]].
151126

127+
<p>Authors who need more control over which characters are included in an initial letter, or who want to apply initial-letter formatting to replaced elements or multiple words can also apply the 'initial-letter' property to the first inline-level child of a block container.
152128

129+
<div class="example">
130+
<pre>
131+
&lt;p>This paragraph has a dropped “T”.
132+
&lt;p>&lt;img alt="H" src="illuminated-h.svg">ere we have an illuminated “H”.
133+
&lt;p>&lt;span>Words may also&lt;/span> be given initial letter styling at the beginning of a paragraph.
134+
</pre>
135+
136+
<pre>
137+
::first-letter, /* style first paragraph's T */
138+
img, /* style illuminated H */
139+
span /* drop Words may also */
140+
{ initial-letters: 2; }
141+
</pre>
142+
</div>
153143

154144
<h3 id="sizing-drop-initials">Creating Initial Letters: the 'initial-letter' property</h3>
155145

@@ -276,13 +266,11 @@ span.initial {
276266

277267
</div>
278268

269+
If 'initial-letter' is applied to an image or other atomic element that does not provide the necessary alignment information, the alignment points for the image must be synthesized from the content edges.
279270

280-
<h4 id="initial-letter-replaced">Applying 'initial-letter' to replaced elements</h4>
281-
282-
'initial-letter' may be applied to an image or other replaced element, if it is the first child of the block container. In this case, the alignment points for the image would be the content edges.
271+
Issue: Need to decide whether using margin edges or content edges for alignment. Writing Modes uses the margin edges for baseline alignment of replaced elements. There are cases for both content-alignment and margin-alignment for text. In both cases the margin box needs to be excluded.
283272

284273

285-
<p class="issue">TK</p>
286274

287275

288276
<h3 id="initial-letter-exclusions">Space Around Initial Letters</h3>

0 commit comments

Comments
 (0)