-
Notifications
You must be signed in to change notification settings - Fork 790
Expand file tree
/
Copy pathtext.src
More file actions
449 lines (366 loc) · 15.7 KB
/
text.src
File metadata and controls
449 lines (366 loc) · 15.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html lang="en">
<!-- $Id: text.src,v 2.20 1998-05-06 02:27:41 ijacobs Exp $ -->
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<TITLE>Text</TITLE>
</HEAD>
<BODY>
<H1 align="center">Text</H1>
<P>The properties defined in the following sections affect the visual
presentation of characters, spaces, words, and paragraphs.
<H2><a name="indentation-prop">Indentation</a>: the <span
class="propinst-text-indent">'text-indent'</span> property</H2>
<!-- #include src=properties/text-indent.srb -->
<P>This property specifies the indentation of the first line of text
in a block. More precisely, it specifies the indentation of the
first box that flows into the block's first <a
href="visuren.html#line-box">line box</a>. The box is indented with
respect to the left (or right, for right-to-left layout) edge of the
line box. User agents should render this indentation as blank space.
<P>Values have the following meanings:</P>
<dl>
<dt><span class="index-inst" title="<length>"><span
class="value-inst-length"><strong><length></strong></span></span>
<dd>The indentation is a fixed length.
<dt><span class="index-inst" title="<percentage>"><span
class="value-inst-percentage"><strong><percentage></strong>
</span></span>
<dd>The indentation is a percentage of the containing
block width.
</dl>
<P>The value of <span
class="propinst-text-indent">'text-indent'</span> may be negative, but
there may be implementation-specific limits.
<div class="example"><P>
The following example causes a '3em' text indent.
<PRE>
P { text-indent: 3em }
</PRE>
</div>
<H2><a name="alignment-prop">Alignment:</a> the <span
class="propinst-text-align">'text-align'</span> property</H2>
<!-- #include src=properties/text-align.srb -->
<P>This property describes how inline content of a block is aligned. Values
have the following meanings:</P>
<dl>
<dt><strong>left</strong>, <strong>right</strong>,
<strong>center</strong>, and <strong>justify</strong>
<dd>Left, right, center, and double justify text, respectively.
<dt><span class="index-inst" title="<string>"><span
class="value-inst-string"><strong><string></strong></span></span>
<dd>Specifies a string on which cells in a table column will
align (see the section on <a href="tables.html#column-alignment">
horizontal alignment in a column</a> for details and an example).
This value applies <em>only</em> to <a href="tables.html">table</a>
cells.
</dl>
<P>A block of text is a stack of <a href="visuren.html#line-box">line
boxes</a>. In the case of 'left', 'right' and 'center', this property specifies
how the inline boxes within each line box align with respect to the line
box's left and right sides; alignment is not with respect to the <a
href="visuren.html#viewport">viewport</a>. In the case of 'justify',
the UA may stretch the inline boxes in addition to adjusting their
positions. (See also <span
class="propinst-letter-spacing">'letter-spacing'</span> and <span
class="propinst-word-spacing">'word-spacing'</span>.)
<div class="example"><P>
In this example, note that since <span
class="propinst-text-align">'text-align'</span> is inherited, all
block-level elements inside the DIV element with 'class=center' will
have their inline content centered.
<PRE>
DIV.center { text-align: center }
</PRE>
</div>
<div class="note"><P>
<em><strong>Note.</strong>
The actual justification algorithm used is user-agent and written language
dependent.</em>
<P><em><span class="index-inst" title="conformance"><a
href="conform.html#conformance">Conforming <!--HTML [What is an "HTML
UA"? BB--> user agents</a></span> may
interpret the value 'justify' as 'left' or 'right', depending on
whether the element's default writing direction is left-to-right or
right-to-left, respectively.</em>
</div>
<H2>Decoration</H2>
<H3><a name="lining-striking-props">Underlining, overlining, striking, and
blinking</a>: the <span
class="propinst-text-decoration">'text-decoration'</span>
property</H3>
<!-- #include src=properties/text-decoration.srb -->
<P> This property describes decorations that are added to the text of
an element. If the property is specified for a <a
href="visuren.html#block-level">block-level</a> element, it affects
all inline-level descendants of the element. If it is specified for (or
affects) an <a href="visuren.html#inline-level">inline-level</a> element, it
affects all boxes generated by the element. If the element has no
content or no text content (e.g., the IMG element in HTML), user
agents must <a href="syndata.html#ignore">ignore</a> this property.
<P>Values have the following meanings:</p>
<dl>
<dt><strong>none</strong>
<dd>Produces no text decoration.
<dt><strong>underline</strong>
<dd>Each line of text is underlined.
<dt><strong>overline</strong>
<dd>Each line of text has a line above it.
<dt><strong>line-through</strong>
<dd>Each line of text has a line through the middle
<dt><strong>blink</strong>
<dd>Text blinks (alternates between visible and invisible).
<a href="conform.html#conformance">Conforming user agents</a>
are not required to support this value.
</dl>
<P> The color(s) required for the text decoration should be derived
from the <span class="propinst-color">'color'</span> property value.
<P> This property is not inherited, but descendant boxes of a
block box should be formatted with the same decoration (e.g.,
they should all be underlined). The color of decorations should remain
the same even if descendant elements have different <span
class="propinst-color">'color'</span> values.
<div class="example"><P>
In the following example for HTML, the text content of all
A elements acting as hyperlinks will be underlined:</p>
<PRE>
A[href] { text-decoration: underline }
</PRE>
</div>
<H3><a name="text-shadow-props">Text shadows</a>: the <span
class="propinst-text-shadow">'text-shadow'</span> property</H3>
<!-- #include src=properties/text-shadow.srb -->
<P>This property accepts a comma-separated list of shadow effects to
be applied to the text of the element. The shadow effects are applied
in the order specified and may thus overlay each other, but they will
never overlay the text itself. Shadow effects do not alter the size of
a box, but may extend beyond its boundaries. The <A
href="visuren.html#stack-level">stack level</a> of the shadow effects
is the same as for the element itself.
<P>Each shadow effect must specify a shadow offset and may optionally
specify a blur radius and a shadow color.
<P>A shadow offset is specified with two <span class="index-inst"
title="<length>"><span
class="value-inst-length"><length></span></span> values that
indicate the distance from the text. The first length value
specifies the horizontal distance to the right of the text. A negative
horizontal length value places the shadow to the left of the text. The
second length value specifies the vertical distance below the text. A
negative vertical length value places the shadow above the text.
<P>A blur radius may optionally be specified after the shadow offset.
The blur radius is a length value that indicates the boundaries of the
blur effect. The exact algorithm for computing the blur effect is not
specified.
<P>A color value may optionally be specified before or after the
length values of the shadow effect. The color value will be used as
the basis for the shadow effect. If no color is specified, the value
of the <span class="propinst-color">'color'</span> property will be
used instead.
<P>Text shadows may be used with the <a
href="selector.html#first-letter"> :first-letter</a> and <a
href="selector.html#first-line">:first-line</a> pseudo-elements.
<div class="example">
<P>The example below will set a text shadow to the right and below the
element's text. Since no color has been specified, the shadow will
have the same color as the element itself, and since no blur radius is
specified, the text shadow will not be blurred:</p>
<PRE>
H1 { text-shadow: 0.2em 0.2em }
</PRE>
<P>The next example will place a shadow to the right and below
the element's text. The shadow will have a 5px blur radius and will be
red.
<PRE>
H2 { text-shadow: 3px 3px 5px red }
</PRE>
<P>The next example specifies a list of shadow effects. The first
shadow will be to the right and below the element's text and will be
red with no blurring. The second shadow will overlay the first shadow
effect, and it will be yellow, blurred, and placed to the left and
below the text. The third shadow effect will be placed to the right
and above the text. Since no shadow color is specified for the third
shadow effect, the value of the element's <span
class="propinst-color">'color'</span>
property will be used:</p>
<PRE>
H2 { text-shadow: 3px 3px red, yellow -3px 3px 2px, 3px -3px }
</PRE>
</DIV>
<div class="example">
<P>Consider this example:
<PRE>
SPAN.glow {
background: white;
color: white;
text-shadow: black 0px 0px 5px;
}
</PRE>
<P>Here, the <span class="propinst-background">'background'</span> and
<span class="propinst-color">'color'</span> properties have the same
value and the <span class="propinst-text-shadow">'text-shadow'</span>
property is used to create a "solar eclipse" effect:</p>
<P><IMG SRC="images/eclipse-outline.gif" alt="Solar eclipse effect"></p>
</DIV>
<div class="note"><P>
<em><strong>Note.</strong>
This property is not defined in CSS1. Some shadow
effects (such as the one in the last example) may render text
invisible in UAs that only support CSS1.
</em>
</div>
<H2><a name="spacing-props">Letter and word spacing</a>: the <span
class="propinst-letter-spacing">'letter-spacing'</span> and <span
class="propinst-word-spacing">'word-spacing'</span> properties</H2>
<!-- #include src=properties/letter-spacing.srb -->
<P>This property specifies spacing behavior between
text characters. Values have the following meanings:</P>
<dl>
<dt><strong>normal</strong>
<dd>The spacing is the normal spacing for the current font.
This value allows the user agent to alter the space
between characters in order to justify text.
<dt><span class="index-inst" title="<length>"><span
class="value-inst-length"><strong><length></strong></span></span>
<dd>This value indicates inter-character space <em>in
addition to</em> the default space between
characters. Values may be negative, but there may be
implementation-specific limits.
User agents may not further increase or decrease the inter-character
space in order to justify text.
</dl>
<P>Character spacing algorithms are user agent-dependent. Character
spacing may also be influenced by justification (see the <span
class="propinst-text-align">'text-align'</span> property).
<div class="example"><P>
In this example, the space between characters in
BLOCKQUOTE elements is increased by '0.1em'.
<PRE>
BLOCKQUOTE { letter-spacing: 0.1em }
</PRE>
<P>In the following example, the user agent is not permitted
to alter inter-character space:</p>
<PRE>
BLOCKQUOTE { letter-spacing: 0cm } /* Same as '0' */
</PRE>
</div>
<P> When the resultant space between two characters is not the same as
the default space, user agents should not use
<span class="index-inst" title="ligatures">ligatures.</span>
<P><span class="index-inst" title="conformance"><a
href="conform.html#conformance">Conforming <!--HTML--> user agents</a></span>
may consider the value of the <span
class="propinst-letter-spacing">'letter-spacing'</span> property to be
'normal'.
<!-- #include src=properties/word-spacing.srb -->
<P>This property specifies spacing behavior between words.
Values have the following meanings:</p>
<dl>
<dt><strong>normal</strong>
<dd>The normal inter-word space, as defined by the current font and/or
the UA.
<dt><span class="index-inst" title="<length>"><span
class="value-inst-length"><strong><length></strong></span></span>
<dd>This value indicates inter-word space <em>in
addition to</em> the default space between
words. Values may be negative, but there may be
implementation-specific limits.
</dl>
<P>Word spacing algorithms are user agent-dependent. Word spacing is
also influenced by justification (see the <span
class="propinst-text-align">'text-align'</span> property).
<div class="example"><P>
In this example, the word-spacing between each word in H1 elements is
increased by '1em'.
<PRE>
H1 { word-spacing: 1em }
</PRE>
</div>
<P><span class="index-inst" title="conformance"><a
href="conform.html#conformance">Conforming <!--HTML--> user agents</a></span> may
consider the value of the <span
class="propinst-word-spacing">'word-spacing'</span> property to be
'normal'.
<!--<H2>Case</H2>-->
<H2><a name="caps-prop">Capitalization</a>: the <span
class="propinst-text-transform">'text-transform'</span> property</H2>
<!-- #include src=properties/text-transform.srb -->
<P>This property controls capitalization effects of
an element's text. Values have the following meanings:</p>
<DL>
<DT><strong>capitalize</strong>
<DD>Puts the first character of each word in uppercase.
<DT><strong>uppercase</strong>
<DD>Puts all characters of each word in uppercase.
<DT><strong>lowercase</strong>
<DD>Puts all characters of each word in lowercase.
<DT><strong>none</strong>
<DD>No capitalization effects.
</DL>
<P> The actual transformation in each case is written language
dependent. See RFC 2070 ([[RFC2070]]) for ways to find the language of
an element.
<P><span class="index-inst" title="conformance"><a
href="conform.html#conformance">Conforming <!--HTML--> user agents</a></span>
may consider the value of <span
class="propinst-text-transform">'text-transform'</span> to be 'none'
for characters that are not from the Latin-1 repertoire and for
elements in languages for which the transformation is different from
that specified by the case-conversion tables of ISO 10646
([[ISO10646]]).
<div class="example"><P>
In this example, all text in an H1 element is transformed to uppercase
text.
<PRE>
H1 { text-transform: uppercase }
</PRE>
</div>
<H2><a name="white-space-prop">Whitespace</a>: the <span
class="propinst-white-space">'white-space'</span> property</H2>
<!-- #include src=properties/white-space.srb -->
<P> This property declares how <a
href="syndata.html#whitespace">whitespace</a> inside the element is
handled. Values have the following meanings:</P>
<!-- See the HTML definition of whitespace -IJ -->
<dl>
<dt><strong>normal</strong>
<dd>This value directs user agents to collapse sequences
of whitespace, and break lines as necessary to fill line boxes.
Additional line breaks may be created by occurrences of "\A" in
generated content (e.g., for the BR element in HTML).
<dt><strong>pre</strong>
<dd>This value prevents user agents from collapsing sequences
of whitespace. Lines are only broken at newlines in the source, or
at occurrences of "\A" in generated content.
<dt><strong>nowrap</strong>
<dd>This value collapses whitespace as for 'normal', but suppresses
line breaks within text except for those created by "\A" in generated
content (e.g., for the BR element in HTML).
</dl>
<div class="example"><P> The following examples show what <a
href="syndata.html#whitespace">whitespace</a> behavior is expected
from the PRE and P elements, and the "nowrap" attribute in HTML.
<PRE>
PRE { white-space: pre }
P { white-space: normal }
TD[nowrap] { white-space: nowrap }
</PRE>
</div>
<P><span class="index-inst" title="conformance"><a
href="conform.html#conformance">Conforming <!--HTML--> user agents</a></span>
may <span class="index-inst" title="ignore"><a
href="syndata.html#ignore">ignore</a></span> the <span
class="propinst-white-space">'white-space'</span> property in author
and user style sheets but must specify a value for it in the default
style sheet.
</BODY>
</HTML>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-declaration:"~/SGML/HTML4.decl"
sgml-default-doctype-name:"html"
sgml-minimize-attributes:t
sgml-nofill-elements:("pre" "style" "br")
sgml-live-element-indicator:t
End:
-->