forked from w3c/csswg-drafts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvisufx.src
More file actions
364 lines (304 loc) · 12.6 KB
/
Copy pathvisufx.src
File metadata and controls
364 lines (304 loc) · 12.6 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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Visual effects</title>
</head>
<body>
<h1>Visual effects</h1>
<H2><a name="overflow-clipping">Overflow and clipping</a></H2>
<P>Generally, the content of a block box is confined to the
content edges of the box. In certain cases, a box may <span
class="index-def"
title="overflow|box::overflow"><dfn>overflow</dfn></span>, meaning its
content lies partly or entirely outside of the box, e.g.:</P>
<ul>
<li>A line cannot be broken, causing the line box to be wider than the
block box.
<li>A block-level box is too wide for the containing block. This may
happen when an
element's <span class="propinst-width">'width'</span> property has a
value that causes the generated block box to spill over
sides of the containing block.
<li>An element's height exceeds an explicit height assigned to the containing
block (i.e., the containing block's height is determined by the <span
class="propinst-height">'height'</span> property, not by content
height).
<li>A descendent box is <a href="visuren.html#absolute-positioning">positioned
absolutely</a>, partly outside the box.
<li>A descendent box has <a href="box.html#margin-properties">negative margins</a>, causing it
to be positioned partly outside the box.
</ul>
<p>Whenever overflow occurs, the <span
class="propinst-overflow">'overflow'</span> property specifies
whether a box is clipped to its content box, and if so, whether
a scrolling mechanism is provided to access any clipped out content.
</p>
<H3><a name="overflow">Overflow</a>: the <span
class="propinst-overflow">'overflow'</span> property</H3>
<!-- #include src=properties/overflow.srb -->
<P>This property specifies whether the content of a block-level
element is clipped when it overflows the element's box (which is
acting as a containing block for the content). Values have the
following meanings:</p>
<dl>
<dt><strong>visible</strong>
<dd>This value indicates that content is not clipped, i.e., it
may be rendered outside the block box.
<dt><strong>hidden</strong>
<dd>This value indicates that the content is clipped and that no
scrolling mechanism should be provided to view the content outside the
clipping region; users will not have access to clipped
content.
<dt><strong>scroll</strong>
<dd>This value indicates that the content is clipped and that if the
user agent uses a scrolling mechanism that is visible on the screen
(such as a scroll bar or a panner), that mechanism should be displayed
for a box whether or not any of its content is clipped. This avoids
any problem with scrollbars appearing and disappearing in a dynamic
environment. When this value is specified and the target medium is
'print', overflowing content should be printed.
<dt><strong>auto</strong>
<dd>The behavior of the 'auto' value is user agent-dependent, but
should cause a scrolling mechanism to be provided for overflowing boxes.
</dl>
<P> Even if <span class="propinst-overflow">'overflow'</span> is set
to 'visible', content may be clipped to a UA's document window by the
native operating environment.
<div class="example"><P>
Consider the following example of a block quotation
(BLOCKQUOTE) that is too big
for its containing block (established by a DIV). Here is
the source document:</p>
<PRE class="html-example">
<DIV>
<BLOCKQUOTE>
<P>I didn't like the play, but then I saw
it under adverse conditions - the curtain was up.
<CITE>- Groucho Marx</CITE>
</BLOCKQUOTE>
</DIV>
</PRE>
<P>Here is the style sheet controlling the sizes and style of the
generated boxes:
<PRE>
div { width : 100px; height: 100px;
border: thin solid red;
}
blockquote { width : 125px; height : 100px;
margin-top: 50px; margin-left: 50px;
border: thin dashed black
}
cite { display: block;
text-align : right;
border: none
}
</PRE>
<P>The initial value of <span
class="propinst-overflow">'overflow'</span> is 'visible', so
the BLOCKQUOTE would be formatted without clipping, something like this:</P>
<div class="figure">
<P><img src="./images/overflow1.png" alt="Rendered overflow"></p>
</div>
<P>Setting <span class="propinst-overflow">'overflow'</span> to
'hidden' for the DIV element, on the other hand, causes the
BLOCKQUOTE to be clipped by the containing block:
<div class="figure">
<P><img src="./images/overflow2.png" alt="Clipped overflow"></p>
</div>
<P>A value of 'scroll' would tell UAs that support
a visible scrolling mechanism to display one so that users
could access the clipped content.
</div>
<H3><a name="clipping">Clipping</a>: the <span
class="propinst-clip">'clip'</span> property</h3>
<!--
<p>[What about the "lost errata" for clip? See
<a href="http://lists.w3.org/Archives/Member/w3c-css-wg/2001OctDec/0218.html">David</a>
and
<a href="http://lists.w3.org/Archives/Member/w3c-css-wg/2001OctDec/0235.html">Eric</a>.
BB]
-->
<p>A <span class="index-def" title="clipping region"><dfn>clipping
region</dfn></span> defines what portion of an element's
border box
<!--<a
href="conform.html#rendered-content">rendered content</a>-->
is visible. By default, the clipping region has the same size and shape
as the element's border box. However, the clipping region may be
modified by the <span class="propinst-clip">'clip'</span> property.
<!-- #include src=properties/clip.srb -->
<P>The 'clip' property applies only to absolutely positioned elements.
<!--that have a <span
class="propinst-overflow">'overflow'</span> property with a value
other than 'visible'-->
Values have the following meanings:</p>
<dl>
<dt><strong>auto</strong>
<dd>The clipping region has the same size and location
as the element's box(es).
<dt><span class="index-def" title="<shape>::definition of"><a
name="value-def-shape"
class="value-def"><strong><shape></strong></a></span>
<dd>In CSS 2.1, the only valid <shape> value is:
rect (<span
class="value-inst-top"><top></span>, <span
class="value-inst-right"><right></span>, <span
class="value-inst-bottom"><bottom></span>, <span
class="value-inst-left"><left></span>)
where <span class="value-inst-top"><top></span> and <span
class="value-inst-bottom"><bottom></span> specify offsets from
the top border edge of the box, and <span
class="value-inst-right"><right></span>, and <span
class="value-inst-left"><left></span> specify offsets from the
left border edge of the box in left-to-right text and from the right
border edge of the box in right-to-left text. Authors should separate
offset values with commas. User agents must support separation with
commas, but may also support separation without commas, because a
previous version of this specification was ambiguous in this respect.
<P><span class="index-def" title="<top>::definition of"><a
name="value-def-top" class="value-def"><top></a></span>, <span
class="index-def" title="<right>::definition of"><a
name="value-def-right" class="value-def"><right></a></span>,
<span class="index-def" title="<bottom>::definition of"><a
name="value-def-bottom" class="value-def"><bottom></a></span>,
and <span class="index-def" title="<left>::definition of"><a
name="value-def-left" class="value-def"><left></a></span> may
either have a <span class="value-inst-length"><length></span>
value or 'auto'. Negative lengths are permitted. The value 'auto'
means that a given edge of the clipping region will be the same as the
edge of the element's generated box (i.e., 'auto' means the same as
'0' for <span class="value-inst-top"><top></span> and <span
class="value-inst-left"><left></span> (in left-to-right text,
<span class="value-inst-right"><right></span> in right-to-left
text), the same as the computed value of the height plus the sum of
vertical padding and border widths for <span
class="value-inst-right"><bottom></span>, and the same as the
computed value of the width plus the sum of the horizontal padding and
border widths for <span class="value-inst-right"><right></span>
(in left-to-right text, <span
class="value-inst-right"><left></span> in right-to-left text),
such that four 'auto' values result in the clipping region being fit
with the border edge).
<P>When coordinates are rounded to pixel coordinates, care should be
taken that no pixels remain visible when <left> and
<right> have the same value (or <top> and <bottom>
have the same value), and conversely that no pixels within the
element's box remain hidden when these values are 'auto'.
</dl>
<P>The element's ancestors may also have clipping regions (e.g. if
their <span class="propinst-overflow">'overflow'</span> property is
not 'visible'); what is rendered is the intersection of the various
clipping regions.
<P>If the clipping region exceeds the bounds of the UA's
document window, content may be clipped to that window by the
native operating environment.
<div class="example"><P>
The following two rules:</P>
<PRE>
p { clip: rect(5px, 40px, 45px, 5px); }
p { clip: rect(5px, 55px, 45px, 5px); }
</PRE>
<P>will create the rectangular clipping regions delimited
by the dashed lines in the following illustrations:</p>
<div class="figure">
<P><IMG src="images/clip.png" alt="Two clipping regions"></p>
</div>
</div>
<div class="note"><P> <em><strong>Note.</strong> In CSS 2.1, all clipping
regions are rectangular. We anticipate future extensions to permit
non-rectangular clipping. Future versions may also reintroduce a
syntax for offsetting shapes from each edge instead of offsetting from
a point.</em></div>
<H2><a name="visibility">Visibility</a>: the <span
class="propinst-visibility">'visibility'</span> property</H2>
<!-- #include src=properties/visibility.srb -->
<p>The <span class="propinst-visibility">'visibility'</span> property
specifies whether the boxes generated by an element are
rendered. Invisible boxes still affect layout (set the <span
class="propinst-display">'display'</span> property to 'none' to
suppress box generation altogether). Values have the following
meanings:</p>
<dl>
<dt><strong>visible</strong>
<dd>The generated box is visible.
<dt><strong>hidden</strong>
<dd>The generated box is invisible (fully transparent), but still
affects layout. Furthermore, descendents of the element will
be visible if they have 'visibility: visible'.
<dt><strong>collapse</strong>
<dd>Please consult the section on
<a href="tables.html#dynamic-effects">dynamic row and column
effects</a> in tables. If used on elements other than rows or columns,
'collapse' has the same meaning as 'hidden'.
</dl>
<P>This property may be used in conjunction with scripts to create
dynamic effects.
<div class="html-example"><P> In the following example, pressing
either form button invokes a user-defined script function that causes
the corresponding box to become visible and the other to be
hidden. Since these boxes have the same size and position, the effect
is that one replaces the other. (The script code is in a hypothetical
script language. It may or may not have any effect in a CSS-capable
UA.)
<pre>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<HTML>
<HEAD>
<STYLE type="text/css">
<!--
#container1 { position: absolute;
top: 2in; left: 2in; width: 2in }
#container2 { position: absolute;
top: 2in; left: 2in; width: 2in;
visibility: hidden; }
-->
</STYLE>
</HEAD>
<BODY>
<P>Choose a suspect:</P>
<DIV id="container1">
<IMG alt="Al Capone"
width="100" height="100"
src="suspect1.jpg">
<P>Name: Al Capone</P>
<P>Residence: Chicago</P>
</DIV>
<DIV id="container2">
<IMG alt="Lucky Luciano"
width="100" height="100"
src="suspect2.jpg">
<P>Name: Lucky Luciano</P>
<P>Residence: New York</P>
</DIV>
<FORM method="post"
action="http://www.suspect.org/process-bums">
<P>
<INPUT name="Capone" type="button"
value="Capone"
onclick='show("container1");hide("container2")'>
<INPUT name="Luciano" type="button"
value="Luciano"
onclick='show("container2");hide("container1")'>
</FORM>
</BODY>
</HTML>
</pre>
</div>
</body>
</html>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:nil
sgml-shorttag:nil
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:nil
sgml-indent-data:t
sgml-parent-document:nil
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
-->