-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Expand file tree
/
Copy pathpercentage-padding-001.html
More file actions
39 lines (33 loc) · 985 Bytes
/
percentage-padding-001.html
File metadata and controls
39 lines (33 loc) · 985 Bytes
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
<!DOCTYPE html>
<script src='/resources/testharness.js'></script>
<script src='/resources/testharnessreport.js'></script>
<script src='/resources/check-layout-th.js'></script>
<link rel="author" title="David Grogan" href="dgrogan@chromium.org">
<link rel="help" href="https://un5n798jx6qx6j0rmf2verhh.julianrbryant.com/css-box-3/#padding-physical" title="Percentages line">
<meta name="assert" content="item's padding is resolved against parent's size, not item's" />
<style>
x-flexbox {
display: flex;
height: 50px;
width: 500px;
}
x-item {
padding-left: 10%;
background: blue;
position: relative; /* Just so offsetLeft returns distance between x-item and div */
}
div {
height: 50px;
width: 50px;
background: orange;
}
</style>
If the item's % padding is calculated correctly, there is a blue square on the left and an orange square on the right, both 50x50.
<x-flexbox>
<x-item>
<div data-offset-x=50></div>
</x-item>
</x-flexbox>
<script>
checkLayout('x-flexbox');
</script>