-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Expand file tree
/
Copy pathanchor-name-multicol-003.html
More file actions
87 lines (87 loc) · 2.29 KB
/
anchor-name-multicol-003.html
File metadata and controls
87 lines (87 loc) · 2.29 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
<!DOCTYPE html>
<title>Anchor name resolution of OOF anchors in multicol</title>
<link rel="help" href="https://drafts.csswg.org/css-anchor-1/#propdef-anchor-name">
<link rel="help" href="https://drafts.csswg.org/css-anchor-1/#anchor-size">
<link rel="author" href="mailto:kojii@chromium.org">
<link rel="author" href="mailto:mstensho@chromium.org">
<link rel="match" href="anchor-name-multicol-003-ref.html">
<style>
.relpos {
position: relative;
}
.abspos {
position: absolute;
}
.columns {
columns: 6;
column-fill: auto;
column-gap: 10px;
width: 170px;
height: 50px;
}
.spacer {
height: 10px;
}
.anchor {
anchor-name: --a1;
margin-left: 10px;
width: 10px;
}
.target {
position: absolute;
left: anchor(--a1 left);
top: anchor(--a1 top);
width: anchor-size(--a1 width);
height: anchor-size(--a1 height);
}
.target::before {
position: absolute;
background: green;
content: "";
}
.target.inside::before {
width: 100%;
height: 50%;
}
.target.outside::before {
width: 20px;
height: 100%;
}
.target.inside.part2::before {
top: 50%;
}
.target.outside.part1::before {
left: 10px;
}
.target.outside.part2::before {
right: 10px;
}
.filler > .background {
background: green;
}
</style>
<!-- All targets should find the abspos anchor -->
<p>There should be a green rectangle below, no red.</p>
<div class="relpos">
<div class="columns relpos">
<div class="relpos">
<div class="relpos">
<div class="spacer"></div>
<div class="anchor" style="height:60px;"></div>
<div style="height:30px;"></div>
<div class="filler" style="width:30px; height:150px; background:red;">
<div style="width:20px; height:20px;" class="background"></div>
<div style="width:10px; height:30px;" class="background"></div>
<div style="height:50px;"></div>
<div style="margin-left:auto; width:10px; height:20px;" class="background"></div>
<div style="margin-left:auto; width:20px; height:30px;" class="background"></div>
</div>
<div class="anchor abspos" style="top:120px; height:100px;"></div>
<div class="target inside part1"></div>
</div>
<div class="target inside part2"></div>
</div>
<div class="target outside part1"></div>
</div>
<div class="target outside part2"></div>
</div>