-
Notifications
You must be signed in to change notification settings - Fork 790
Expand file tree
/
Copy pathtext.src
More file actions
372 lines (292 loc) · 12.5 KB
/
text.src
File metadata and controls
372 lines (292 loc) · 12.5 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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html lang="en">
<!-- $Id: text.src,v 1.28 1997-12-29 22:03:20 ijacobs Exp $ -->
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<TITLE>Text</TITLE>
<LINK rel="next" href="lists.html">
<LINK rel="previous" href="fonts.html">
<LINK rel="STYLESHEET" href="style/default.css" type="text/css">
</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>The property specifies the indentation of the first line of text
relative to the horizontal edge of the element's content. The
indentation forms a blank space between the edge of the content and
the first character of the first line. The property does not apply
directly to text in a child element, however it will apply through
inheritance if the property is not explicitly declared for the
child.
<P>The value of <span
class="propinst-text-indent">'text-indent'</span> may be negative, but
there may be implementation-specific limits. An indentation is not
inserted when a line of text is broken by a child element (such as
the BR element in HTML).
<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 text is aligned within the
element. The actual justification algorithm used is UA and
human-language dependent.
<div class="example"><P>
In this example, note that since <span
class="propinst-text-align">'text-align'</span> inherits, all
block-level elements inside the DIV element with 'class=center' will
be centered. Note that alignments are relative to the width of the
element, not the <a href="media.html#canvas">canvas</a>. If 'justify'
is not supported, the UA will supply a replacement. Typically, this
will be 'left' for western languages.
<PRE>
DIV.center { text-align: center }
</PRE>
</div>
<P> UAs may treat 'justify' as 'left' or 'right', depending on whether
the element's default writing direction is left-to-right or
right-to-left, respectively.
<H2>Decoration</H2>
<H3><a name="lining-striking-props">Underlining, over lining, 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 element has no text (e.g., the IMG element in
HTML) or is an empty element (e.g., EM in HTML), this
property has no effect. A value of 'blink' causes the text to blink.
<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 elements should match their
parent. E.g., if an element is underlined, the line should span the
child elements. The color of the underlining will remain the same even
if descendant elements have different <span
class="propinst-color">'color'</span> values.
<div class="example"><P>
In the following example, all links are underlined
(i.e., all 'A' elements with a 'HREF' attribute).
<PRE>
A:link, A:visited, A:active { text-decoration: underline }
</PRE>
</div>
<P>The value 'blink' causes the text to blink on output devices that
can support blinking.
<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>The 'text-shadow' 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 the element, but may extend beyond its boundaries.
The <A href="flowobj.html#stack-level">Z-order</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 length values which indicate
the 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 which indicate 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 'color' property will be used instead.
<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:
<PRE>
H1 { text-shadow: 0.2em 0.2em }
</PRE>
<P>The example below 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>In the example below, a list of shadow effects are specified. The
first shadow will be to the right and below the element's text, and it
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 color of the element itself will be used:
<PRE>
H2 { text-shadow: 3px 3px red, yellow -3px 3px 2px, 3px -3px }
</PRE>
</DIV>
<P>The 'text-shadow' property does not exist in CSS1, and some shadow
effects may render text invisible in UAs which only supports CSS1.
<div class="example">
<P>Consider this example:
<PRE>
SPAN.glow {
background: white;
color: white;
text-shadow: black 0px 0px 5px;
}
</PRE>
<P>Here, the 'background' and 'color' properties have the same value
and the 'text-shadow' property is used to create a "solar eclipse"
effect:
<P><IMG SRC="images/eclipse-outline.gif" alt="Solar eclipse effect">
</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> The length unit indicates an addition to the default space between
characters. Values can be negative, but there may be
implementation-specific limits. The UA is free to select the exact
spacing algorithm. The letter spacing may also be influenced by
justification (which is a value of the <span
class="propinst-text-align">'text-align'</span> property).
<div class="example"><P>
In this example, the letter-spacing between each character in
BLOCKQUOTE elements is increased by '0.1em'.
<PRE>
BLOCKQUOTE { letter-spacing: 0.1em }
</PRE>
</div>
<P> With a value of 'normal', the UAs may change the space between
letters to justify text. This will not happen if <span
class="propinst-letter-spacing">'letter-spacing'</span> is explicitly
set to a <span class="value-inst-length"><length></span> value,
as in:
<PRE>
BLOCKQUOTE { letter-spacing: 0 }
BLOCKQUOTE { letter-spacing: 0cm }
</PRE>
<P> When the resultant space between two letters is not the same as
the default space, UAs should not use ligatures.
<!-- proposed -->
<P> A value of 'auto' tells the user agent to adjust the spacing
between letters so that the entire text of an element fits on one
line. This value should only be used with special elements (e.g.,
headlines). See also the <span
class="propinst-font-size">'font-size'</span> property for related
'auto' behavior.
<!-- end proposed -->
<P>UAs may interpret any value of <span
class="propinst-letter-spacing">'letter-spacing'</span> as
'normal'. See the section on <a
href="convent.html#conformance">conformance</a> for more information.
<!-- #include src=properties/word-spacing.srb -->
<P> The length unit indicates an addition to the default space between
words. Values can be negative, but there may be
implementation-specific limits. The UA is free to select the exact
spacing algorithm. The word spacing may also be influenced by
justification (which is a value of 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>UAs may interpret any value of <span
class="propinst-word-spacing">'word-spacing'</span> as 'normal'. See
the section on <a href="convent.html#conformance">conformance</a> for
more information.
<H2>Case</H2>
<H3><a name="caps-prop">Capitalization</a>: the <span
class="propinst-text-transform">'text-transform'</span> property</H3>
<!-- #include src=properties/text-transform.srb -->
<P>The values of this property have the following meanings:
<DL>
<DT>
'capitalize'
<DD>
uppercases the first character of each word
<DT>
'uppercase'
<DD>
uppercases all letters of the element
<DT>
'lowercase'
<DD>
lowercases all letters of the element
<DT>
'none'
<DD>
neutralizes inherited value.
</DL>
<P> The actual transformation in each case is human language
dependent. See <a rel="biblioentry"
href="./refs.html#ref-RFC2070" class="normref">[RFC2070]</a> for ways to find the
language of an element.
<P> UAs may ignore <span
class="propinst-text-transform">'text-transform'</span> (i.e., treat
it as '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 <a
rel="biblioentry" href="./refs.html#ref-UNICODE" class="normref">[UNICODE]</a>.
<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>
<H3>Special first letter/first line</H3>
<P>Please consult the sections on <a
href="./selector.html#first-line">first line</a> and <a
href="./selector.html#first-letter">first letter</a> for information
on specially formatting the first letter or line of a paragraph.
<H2><a name="white-space-prop">White space</a>: the <span
class="propinst-white-space">'white-space'</span> property</H2>
<!-- #include src=properties/white-space.srb -->
<P> This property declares how whitespace inside the element is
handled: the 'normal' way (where whitespace is collapsed), as 'pre'
(which behaves like the PRE element in HTML) or as 'nowrap' (where
wrapping is done only through elements that force line breaks such as
the BR element in HTML):
<div class="example"><P>
The following examples show what whitespace behavior is expected from
the PRE and P elements in HTML.
<PRE>
PRE { white-space: pre }
P { white-space: normal }
</PRE>
</div>
<P> The initial value of 'white-space' is 'normal', but a UA will
typically have default values for each element.
<P> UAs may ignore the 'white-space' property in author's and reader's
style sheets, and use the UA's default values instead. See the section
on <a href="convent.html#conformance">conformance</a> for more information.
<H2>Text in HTML</H2>
<H3>Forcing a line break</H3>
<P> The current CSS2 properties and values cannot describe the
behavior of the BR element; the BR element specifies a line break
between words. In effect, the element is replaced by a line
break. Future versions of CSS may handle added and replaced content,
but CSS2-based formatters must treat BR specially.
</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:
-->