-
Notifications
You must be signed in to change notification settings - Fork 790
Expand file tree
/
Copy pathExclusions.src.html
More file actions
1157 lines (867 loc) · 32.7 KB
/
Exclusions.src.html
File metadata and controls
1157 lines (867 loc) · 32.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
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html dir="ltr" lang="en">
<head profile="http://www.w3.org/2006/03/hcard">
<meta name="generator" content=
"HTML Tidy for Mac OS X (vers 31 October 2006 - Apple Inc. build 15.3.6), see www.w3.org">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>CSS Exclusions Module</title>
<link href="http://dev.w3.org/csswg/default.css" rel="stylesheet" type=
"text/css">
<link href="http://www.w3.org/StyleSheets/TR/W3C-ED.css" rel="Stylesheet"
type="text/css">
</head>
<body>
<div class="head">
<!--begin-logo-->
<p><a href="http://www.w3.org/"><img alt="W3C" height="48" src=
"http://www.w3.org/Icons/w3c_home" width="72"></a> <!--end-logo--></p>
<h1>CSS Exclusions Module</h1>
<h2 class="no-num no-toc" id="longstatus-date">Editor's Draft
[DATE]</h2>
<dl>
<dt>This version:</dt>
<dd><a href=
"[VERSION]">http://www.w3.org/csswg/css3-exclusions</a></dd>
<dt>Latest version:</dt>
<dd><a href=
"http://www.w3.org/TR/css3-exclusions">http://www.w3.org/csswg/css3-exclusions</a></dd>
<dt>Previous version:</dt>
<dd>none</dd>
<dt>Editors:</dt>
<dd class="vcard"><span class="fn">Vincent Hardy</span>,
<span class="org">Adobe Systems, Inc.</span>, <span class=
"email">vhardy@adobe.com</span></dd>
<dt>Authors and Former Editors:</dt>
<dd class="vcard"><span class="fn">Stephen Zilles</span>,
<span class="org">Adobe Systems, Inc.</span>, <span class=
"email">szilles@adobe.com</span></dd>
<dd class="vcard"><span class="fn">Alexandru Chiculita</span>,
<span class="org">Adobe Systems, Inc.</span>, <span class=
"email">achicu@adobe.com</span></dd>
<dd class="vcard"><span class="fn">Andrei Bucur</span>,
<span class="org">Adobe Systems, Inc.</span>, <span class=
"email">abucur@adobe.com</span></dd>
<dd class="vcard"><span class="fn">Mihnea Ovidenie</span>,
<span class="org">Adobe Systems, Inc.</span>, <span class=
"email">mihnea@adobe.com</span></dd>
<dd class="vcard"><span class="fn">Peter Sorotokin</span>,
<span class="org">Adobe Systems, Inc.</span>, <span class=
"email">psorotok@adobe.com</span></dd>
<dd class="vcard"><span class="fn">Virgil Palanciuc</span>,
<span class="org">Adobe Systems, Inc.</span>, <span class=
"email">virgilp@adobe.com</span></dd>
<dd class="vcard"><span class="fn">Arno Gourdol</span>,
<span class="org">Adobe Systems, Inc.</span>, <span class=
"email">agourdol@adobe.com</span></dd>
</dl><!--begin-copyright--><!--end-copyright-->
<hr title="Separator for header">
</div>
<h2 class="no-num no-toc" id="abstract">Abstract</h2>
<p>CSS Exclusions extend the concept of CSS floats (see [[CSS21]]): they
provide the ability to exclude arbitrary areas around which content can
flow. CSS Exclusions also allow content to flow in these exclusions areas.
CSS Exclusions enable sophisticated layouts, for example having content
flow into and/or around circles or other, arbitrarily complex shapes.</p>
<h2 class="no-num no-toc" id="status">Status of this document</h2>
<!--begin-status-->
<p><em>This section describes the status of this document at the time of
its publication. Other documents may supersede this document. A list of
current W3C publications and the latest revision of this technical report
can be found in the <a href="http://www.w3.org/TR/">W3C technical reports
index at http://www.w3.org/TR/.</a></em></p>
<p>This is a public copy of the editors' draft. It is provided for
discussion only and may change at any moment. Its publication here does not
imply endorsement of its contents by W3C. Don't cite this document other
than as work in progress.</p>
<p>The archived public mailing list www-style@w3.org is preferred for
discussion of this specification. When sending e-mail, please put the text
"css3-exclusions" in the subject, preferably like this: "[css3-exclusions]
… summary of comment …"</p><!--end-status-->
<h2 class="no-num no-toc" id="contents">Table of contents</h2>
<!--begin-toc-->
<!--end-toc-->
<h2 id="exclusions-abstract">Introduction</h2>
<p>The sections below define features that allow text to wrap around and
inside non-rectangular shapes. The term <strong>"exclusion shape"</strong>
refers to the exterior of the shape and the term <strong>"content
shape"</strong> refers to the interior of the shape. The text will wrap
around the <strong>"exclusion shape"</strong> and will wrap inside the
<strong>"content shape"</strong>.</p>
<h2 id="background">Background</h2>
<p><em>This section is not normative.</em></p>
<p>Exclusions are arbitrary shapes that will be avoided by the user agent
when laying out content. The exclusion shape of an element is generated
from the element's 'wrap-shape' property. The exclusion area is computed
relative to the content box of the element on which the exclusion is
specified.</p>
<p>Elements that specify 'wrap-shape-mode' different than 'none' setup a
wrapping context for all the child elements.</p>
<p><strong>Note:</strong> Elements that have no wrapping context are not
affected by any exclusion.</p>
<p>Exclusion shapes affect only the content outside the element on which
the exclusion was defined. In other words, exclusion shapes do not affect
the element's children.</p>
<p>The 'wrap-shape-mode' property is used to enable the definition of
exclusion shape. Setting 'wrap-shape-mode' to something other than 'none'
will affect both exterior and interior element's content. It will make all
the elements outside wrap around the shape defined by 'wrap-shape'.
Moreover, the children elements will wrap inside the specified shape.</p>
<p><br></p>
<p>There are two other properties that can be used in conjunction with the
'wrap-shape':</p>
<dl>
<dt>'wrap-shape-padding'</dt>
<dd>contracts the boundary of the wrap shape to obtain a content
shape</dd>
<dt>'wrap-shape-margin'</dt>
<dd>expands the boundary of the wrap shape to obtain an exclusion
shape</dd>
</dl>
<p>By default, the shape is defined by the content box of the element. The
content shape will be intersected with the exclusion shape at the
content-block coordinate space using exclusion shape projections. If
multiple parent elements define content shapes, only the nearest one in the
DOM tree is used to calculate the wrapping area inside which the element is
laid out.</p>
<p>Another property, 'wrap-shape-order', describes the layer at which the
exclusion works. An exclusion can affect all the elements in the same
exclusion context with the 'wrap-shape-order' smaller or equal than its
'wrap-shape-order'.</p>
<p>The 'wrap-shape-order' property was necessary to describe a sort of
grouping between the elements affected by exclusion shapes. We wanted to
avoid overloading the meaning of 'z-index' property (which is available
only for elements with ''position'' property set) and also we wanted
something more than just the DOM order.</p>
<p><span>The ‘wrap-shape-order’ property does not influence the positioning
of DOM elements.</span><br></p>
1A2
<p>When laying out content, the user agent will compute a depende
10A26
ncy graph
for DOM elements that will take wrap shapes into account. The dependency
graph will be computed based on the values of 'wrap-shape-order' property.
For elements with equal 'wrap-shape-order' values, dependency is computed
based on the order of the elements in DOM.</p>
<h3 id="exclusion-properties">Properties</h3>
<h4>The 'wrap-shape-mode' property</h4>
<p>By default, the property has the value 'none' and the engine will not
use the element as an text-wrapping exclusions for other elements. Setting
the property to 'around', 'left', 'right', 'maximum' or 'top-bottom' will
enable the exclusion text-wrapping features and the wrapping mode for the
outside content. The element's inside content will always fill the content
shape.</p>
<p>The element will be considered an exclusion shape for anything outside
the element and a content shape for everything inside that element. By
'outside' we mean the elements in DOM that are not children of the element
on which the wrap shape was defined and have a wrapping context. By
'inside' we mean the children of the element on which the wrap shape was
defined. The default shape is the content box as defined by the CSS box
model.</p>
<p>When the property is set to 'content' only the elements inside the
element will wrap inside the content shape. The 'content' value is used to
disable the exclusion shape while still keeping the content shape
enabled.</p>
<p>The content shape does not affect the element's children with 'position'
= fixed or absolute (and the children of those elements).</p>
<table class="propdef">
<tr>
<th>Name:</th>
<td><dfn id="wrap-shape-mode">wrap-shape-mode</dfn></td>
</tr>
<tr>
<th>Value:</th>
<td>none | around | left | right | maximum | top-bottom |
content</td>
</tr>
<tr>
<th>Initial:</th>
<td>none</td>
</tr>
<tr>
<th>Applies to:</th>
<td>any block element</td>
</tr>
<tr>
<th>Inherited:</th>
<td>no</td>
</tr>
<tr>
<th>Percentages:</th>
<td>N/A</td>
</tr>
<tr>
<th>Media:</th>
<td>visual</td>
</tr>
<tr>
<th>Computed value:</th>
<td>as specified</td>
</tr>
</table>
<ul>
<li><strong>none</strong>: Disables the text wrapping feature. Setting
the 'wrap-shape-mode' to 'none' will disable both the exclusion shape
and the content shape.</li>
<li><strong>around</strong>: Wrap the outside content on all sides of
the exclusion (see the example 1).</li>
<li><strong>left</strong>: Wrap the outside content on the left side of
the exclusion.</li>
<li><strong>right</strong>: Wrap the outside content on the right side
of the exclusion.</li>
<li><strong>maximum</strong>: Wrap the outside content only in the
segment (left/right) with the maximum size.</li>
<li><strong>top-bottom</strong>: Wrap the outside content on top and
bottom of the exclusion.</li>
<li><strong>content</strong>: Do not wrap the outside content. Wrap
only the inside content.</li>
</ul>
<table>
<tr>
<td><img src="images/wrap-shape-mode-around.jpg" alt=
"Example rendering for wrap-shape-mode: around"></td>
<td><img src="images/wrap-shape-mode-content.jpg" alt=
"Example rendering for wrap-shape-mode: content"></td>
</tr>
<tr>
<td><img src="images/wrap-shape-mode-left.jpg" alt=
"Example rendering for wrap-shape-mode: left"></td>
<td><img src="images/wrap-shape-mode-right.jpg" alt=
"Example rendering for wrap-shape-mode: right"></td>
</tr>
<tr>
<td><img src="images/wrap-shape-mode-max.jpg" alt=
"Example rendering for wrap-shape-mode: maximum"></td>
<td><img src="images/wrap-shape-mode-top-bottom.jpg" alt=
"Example rendering for wrap-shape-mode: top-bottom"></td>
</tr>
</table>
<div class="example">
<p>Define a circle as an exclusion shape. The center of the circle
shape is computed as follows: cx = 50% from the div width, cy = 50%
from the div height. The div has the id = "circle" and the center of
the circle is calculated percent from the div box dimensions. The
radius cannot be specified as percent, therefore is specified in
units.</p>
<pre>
<style>
#circle {
wrap-shape: circle(50%, 50%, 30px);
wrap-shape-margin: 10px;
}
</style>
<div id="circle">
<img src="mycircle.png"/>
</div>
<div>Lorem ipsum</div>
</pre>
<p>It might be easier to just use the original image alpha channel to
define the exclusion shape.</p>
<pre>
<style>
#circle {
background: url(mycircle.png);
wrap-shape-image: url(mycircle.png);
wrap-shape-margin: 10px;
}
</style>
<div id="circle"></div>
<div>Lorem ipsum</div>
</pre>
<div class="figure">
<p><img src="images/example1.jpg" alt=
"Text wrapping around a circle"></p>
<p class="caption">The #circle DIV's shape is used as an exclusion
for the region with content. Note: mycircle.png has a solid
fill</p>
</div>
</div>
<h5>Combining exclusions</h5>
<p>There are cases when multiple exclusions with different 'left' or
'right' modes will overlap the same text lines. In that case the rules will
still apply, meaning that overlapping lines will be skipped (see the image
below for more details).</p>
<p><img src="images/wrap-shape-mode-combine.jpg" alt=
"Combining exclusions with left and right wrap modes"></p>
<p>We thought about defining a value 'exclusion' ('no-content') for the
'wrap-shape-mode' property. Such value would make the wrap shape as
exclusion only, as opposed to content. However, we were unable to find a
compelling reason/use case for such a value.</p>
<p class="issue">This section on grouping exclusions or describing their interactions
needs to be further detailed.</p>
<h4>The 'wrap-shape-order' property</h4>
<p>Exclusions will only affect the block elements with equal or smaller
'wrap-shape-order' value in the same wrapping context. The values can be
both positive and negative. A 'wrap-shape-order' value other than auto,
will establish a new wrapping context, in the same way 'z-index' non auto
values establish a new stacking context.</p>
<p>The user agent will sort all the elements using the 'wrap-shape-order'
property. The elements with a smaller order will wrap around the elements
with bigger 'wrap-shape-order'. Elements with equal 'wrap-shape-order'
values will be sorted using the order in the source DOM.</p>
<p>When the 'wrap-shape-order' is set to auto, the 'wrap-shape-order' is
set to 0.</p>
<table class="propdef">
<tr>
<th>Name:</th>
<td><dfn id="wrap-shape-order">wrap-shape-order</dfn></td>
</tr>
<tr>
<th>Value:</th>
<td><var><integer></var> | auto</td>
</tr>
<tr>
<th>Initial:</th>
<td>auto</td>
</tr>
<tr>
<th>Applies to:</th>
<td>any block element, exclusions</td>
</tr>
<tr>
<th>Inherited:</th>
<td>no</td>
</tr>
<tr>
<th>Percentages:</th>
<td>N/A</td>
</tr>
<tr>
<th>Media:</th>
<td>visual</td>
</tr>
<tr>
<th>Computed value:</th>
<td>as specified</td>
</tr>
</table>
<p>Values have the following meaning:</p>
<ul>
<li><strong><integer></strong>: The order of the wrapping shape.
The element also establishes a new wrapping context.</li>
<li><strong>auto</strong>: The 'wrap-shape-order' is set to 0. The
element does not establish a new wrapping context, unless it is a root
element.</li>
</ul>
<h4>The 'wrap-shape' property</h4>
<p>Exclusion shape can get out of the content box of the element on which
it is defined. In this case, the exclusion shape is not clipped to the
margins of the</p>
<p>As opposed to the exclusion shape, the content shape will be clipped by
the content-box rectangle.</p>
<div class="example">
<p>Exclusion shape (and content shape) defined using a polygon</p>
<pre>
wrap-shape: polygon(x1, y1, …, xn, yn);
</pre>
</div>
<table class="propdef">
<tr>
<th>Name:</th>
<td><dfn id="wrap-shape">wrap-shape</dfn></td>
</tr>
<tr>
<th>Value:</th>
<td><var><shape> | auto</var></td>
</tr>
<tr>
<th>Initial:</th>
<td>auto</td>
</tr>
<tr>
<th>Applies to:</th>
<td>any block element</td>
</tr>
<tr>
<th>Inherited:</th>
<td>no</td>
</tr>
<tr>
<th>Percentages:</th>
<td>relative to the element width or height</td>
</tr>
<tr>
<th>Media:</th>
<td>visual</td>
</tr>
<tr>
<th>Computed value:</th>
<td>the specified value</td>
</tr>
</table>
<p>Shapes are used to describe the value of the 'wrap-shape' property. The
'wrap-shape' property is used to define the boundary in which to flow
content and also used to define the area to be avoided when laying out
content.</p>
<p>The shape can be defined using SVG style basic shapes as defined by the
SVG Shapes.</p>
<dl>
<dt>auto</dt>
<dd>The wrap-shape will computed based on the content box of the
element.</dd>
<dt><shape></dt>
<dd>A shape defined in the <a href="#computing-shapes">Computing the
shapes</a> section.</dd>
</dl>
<h5 id="computing-shapes">Computing the shapes</h5>
<p>All the lengths can be expressed in percentages and are defined in the
coordinate space of the element. Percentages will take into account the
element width/height excluding any padding or margins. The (x,y)
coordinates are relative to the block's content box.</p>
<p>When defining a polygon area using percentages, the content box of the
element must always be fully known in advance.</p>
<dl>
<dt>rect(x, y, width, height, [[rx], ry])</dt>
<dd>
<ul>
<li><strong>x, y, width and height</strong> - define the
bounding box of the rectangle</li>
<li><strong>rx</strong> - For rounded rectangles, the x-axis
radius of the ellipse used to round off the corners of the
rectangle</li>
<li><strong>ry</strong> - For rounded rectangles, the y-axis
radius of the ellipse used to round off the corners of the
rectangle</li>
</ul>
</dd>
<dt>circle(cx, cy, r)</dt>
<dd>
<ul>
<li><strong>cx</strong> - The x-axis coordinate of the center
of the circle</li>
<li><strong>cy</strong> - The y-axis coordinate of the center
of the circle</li>
<li><strong>r</strong> - The radius of the circle. Note: Cannot
be expressed as a percentage.</li>
</ul>
</dd>
<dt>ellipse(cx, cy, rx, ry)</dt>
<dd>
<ul>
<li><strong>cx</strong> - The x-axis coordinate of the center
of the ellipse</li>
<li><strong>cy</strong> - The y-axis coordinate of the center
of the ellipse</li>
<li><strong>rx</strong> - The x-axis radius of the ellipse</li>
<li><strong>ry</strong> - The y-axis radius of the ellipse</li>
</ul>
</dd>
<dt>polygon([fillRule], x1, y1 x2, y2 x3, y3 … xn, yn)</dt>
<dd>
<ul>
<li><strong>fillRule</strong> - The filling rule used to
determine the interior of the polygon. See fill-rule property
in SVG for details. Possible values are nonzero or evenodd.
Default value when omitted is nonzero.</li>
<li><strong>xi</strong> - The x-axis coordinate of the i-th
vertex of the polygon</li>
<li><strong>yi</strong> - The y-axis coordinate of the i-th
vertex of the polygon</li>
</ul>
<p>If the polygon is not closed the user-agent will automatically
add a new vertex at the end.</p><br>
</dd>
<dt>path([fillRule], ...)</dt>
<dd>
<ul>
<li><strong>fillRule</strong> - The filling rule used to
determine the interior of the polygon. See fill-rule property
in SVG for details. Possible values are nonzero or evenodd.
Default value when omitted is nonzero.</li>
</ul>
<p>The content of the path() function will be parsed using SVG
PathData notation.</p>
</dd>
</dl>
<div class="example">
<pre>
<div id="circle" style="wrap-shape: circle(50%, 50%, 40px); width: 100px;
height: 100px;"></div>
</pre>
<p>In this example, the actual position of the exclusion shape polygon
is determined based on the position of the "circle" div element.</p>
</div>
<h4>Define exclusion using an image alpha channel: 'wrap-shape-image'
property</h4>
<p>One can define an exclusion by specifying a source image whose alpha
channel is used to compute the exclusion shape. As image, one can specify
the same values as the ones used when defining the values for the
'background-image' property.</p>
<p>The exclusion shape is computed to be the path that encloses the area
where the opacity of the specified image is greater than the
'wrap-shape-image-threshold' value. If the 'wrap-shape-image-threshold' is
not specified, the default value to be considered is 50%.</p>
<p>Note: Images can also define cavities and text should wrap inside them.
In order to avoid that, another exclusion element can be overlaid.</p>
<div class="example">
<p>Exclusion shape defined using the alpha channel of the specified
image, opacity threshold 50%.</p>
<pre>
<style>
#id {
wrap-shape-image: url(myimage.png);
}
</style>
</pre>
</div>
<table class="propdef">
<tr>
<th>Name:</th>
<td><dfn id="wrap-shape-image">wrap-shape-image</dfn></td>
</tr>
<tr>
<th>Value:</th>
<td>none | <var><url></var></td>
</tr>
<tr>
<th>Initial:</th>
<td>none</td>
</tr>
<tr>
<th>Applies to:</th>
<td>any block element</td>
</tr>
<tr>
<th>Inherited:</th>
<td>no</td>
</tr>
<tr>
<th>Percentages:</th>
<td>N/A</td>
</tr>
<tr>
<th>Media:</th>
<td>visual</td>
</tr>
<tr>
<th>Computed value:</th>
<td>the specified value</td>
</tr>
</table>
<h4>'wrap-shape-image-threshold' property</h4>
<p>Defines the alpha channel threshold used to define the shape using an
image. The default is 50%, meaning that all the pixels that are more than
50% transparent define the path of the exclusion shape.</p>
<div class="example">
<p>Exclusion shape defined using the alpha channel of the specified
image, opacity filter 75%.</p>
<pre>
<style>
#id {
wrap-shape-image: url(myimage.png);
wrap-shape-image-threshold: 75%;
}
</style>
</pre>
</div>
<table class="propdef">
<tr>
<th>Name:</th>
<td><dfn id=
"wrap-shape-image-threshold">wrap-shape-image-threshold</dfn></td>
</tr>
<tr>
<th>Value:</th>
<td><var><percent></var></td>
</tr>
<tr>
<th>Initial:</th>
<td>50%</td>
</tr>
<tr>
<th>Applies to:</th>
<td>any block element</td>
</tr>
<tr>
<th>Inherited:</th>
<td>no</td>
</tr>
<tr>
<th>Percentages:</th>
<td>N/A</td>
</tr>
<tr>
<th>Media:</th>
<td>visual</td>
</tr>
<tr>
<th>Computed value:</th>
<td>the specified value</td>
</tr>
</table>
<h4>Other wrap-shape-image properties</h4>
<p>'wrap-shape-image-repeat', 'wrap-shape-image-attachment',
'wrap-shape-image-position', 'wrap-shape-image-size'</p>
<p>These properties are equivalent to the ones available for the
''background'' property as defined in CSS Background module . The
properties apply only to the 'wrap-shape-image'.</p>
<h4>'wrap-shape-margin', 'wrap-shape-padding' properties</h4>
<p>Because the 'wrap-shape' and 'wrap-shape-image' properties define a
single shape for both the exclusion shape and the content shape, two new
properties allow to distinguish between them even more using specified
offsets: 'wrap-shape-margin' property can be used to offset the exclusion
shape from the one specified with 'wrap-shape' or 'wrap-shape-image'
properties. 'wrap-shape-padding' property can be used to offset the content
shape from the one specified with 'wrap-shape' or 'wrap-shape-image'
properties.</p>
<p>The exclusion shape is used to wrap elements that are not content of the
specified block. The content shape is used to wrap the content
elements.</p>
<p>Both margin and padding can take negative values. However, the content
shape will be clipped by the content-box rectangle, so that interior
elements will not be rendered outside the content-box of the block
element.</p>
<div class="example">
<p>Text wrapping around an irregular shape.</p>
<pre>
<style>
#div2 {
wrap-shape: poly(50px, 50px, 10px);
wrap-shape-margin: 10px;
wrap-shape-padding: 10px;
}
</style>
</pre>
</div>
<h4>Affecting the exclusion shape</h4>
<table class="propdef">
<tr>
<th>Name:</th>
<td><dfn id="wrap-shape-margin">wrap-shape-margin</dfn></td>
</tr>
<tr>
<th>Value:</th>
<td>length</td>
</tr>
<tr>
<th>Initial:</th>
<td>0</td>
</tr>
<tr>
<th>Applies to:</th>
<td>any block element</td>
</tr>
<tr>
<th>Inherited:</th>
<td>no</td>
</tr>
<tr>
<th>Percentages:</th>
<td>N/A</td>
</tr>
<tr>
<th>Media:</th>
<td>visual</td>
</tr>
<tr>
<th>Computed value:</th>
<td>the specified value</td>
</tr>
</table>
<h4>Affecting the content shape</h4>
<table class="propdef">
<tr>
<th>Name:</th>
<td><dfn id="wrap-shape-padding">wrap-shape-padding</dfn></td>
</tr>
<tr>
<th>Value:</th>
<td>length</td>
</tr>
<tr>
<th>Initial:</th>
<td>0</td>
</tr>
<tr>
<th>Applies to:</th>
<td>any block element</td>
</tr>
<tr>
<th>Inherited:</th>
<td>no</td>
</tr>
<tr>
<th>Percentages:</th>
<td>N/A</td>
</tr>
<tr>
<th>Media:</th>
<td>visual</td>
</tr>
<tr>
<th>Computed value:</th>
<td>the specified value</td>
</tr>
</table>
<p><img src="images/shapes.png" alt=
"Visual example for wrap-shape-padding and wrap-shape-margin"></p>
<h2 id='q-and-a'>Q&A</h2>
<p><em>1. Can the wrap-shape-margin and wrap-shape-padding be
negative?</em><br>
In the CSS box model only the margins can be negative. This is also
applicable in the wrap-shape case to obtain a pull content effect for
exclusions.</p>
<p><em>2. How is wrapping around concave shapes?</em><br>
The text will be flowed around the concave shape and will fill all the
available outer space.</p>
<p><em>3. All of the wrap-shape-mode values other than ‘none’ define a
content shape for child elements, and while the different values (left,
right, around) may affect how the exclusion shape interacts with other
elements, they do not change how the content shape works. Correct?</em><br>
Yes.</p>
<p><em>4. How does a content shape interact with non-text content?</em><br>
The content shape does not affect elements with position absolute or
fixed.</p>
<p><em>4.1 Does it clip an image?</em><br>
No.</p>
<p><em>4.2 Does it clip the background-color and background-image?</em><br>
No.</p>
<p><em>4.3 If there is a border defined does it draw around the content
shape (plus wrap-shape-padding) boundary?</em><br>
No.</p>
<p><em>5. I am assuming that a content shape (and perhaps the content
itself) may determine an element’s height and width if they are not
specified, but they do not override explicit height and width.</em><br>
Yes, the content shape do not override explicit height and width. The
content shape is clipped by the content-box margins.<br>
When the content box of the element is not defined, the content shape
cannot be defined using percentages. In this case, the content shape will
determine the elements width and height.</p>
<p><em>6. The permissible wrap-shape-order property values should include
“auto”</em>.<br>
This is correct. Wrap shape order is not an inherited property in the same
way z-index is not inheritable.</p>
<p><em>7. The element will be considered an exclusion for anything outside