blob: 1141afdb3c59016d890aee4343c45eaf77c1ea5b (
plain)
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
|
<!DOCTYPE html>
<html>
<head>
<title>Calc</title>
<style>
.container {
border: 1px solid pink;
width: 250px;
}
.box {
border: 1px solid black;
height: 100px;
}
</style>
</head>
<body>
<h1>CSS calc() Tests</h1>
<p>The boxes change their width property.</p>
<p>calc(100px)</p>
<div class="container">
<div class="box" style="width: calc(100px);"></div>
</div>
<p>calc(100px + 30% - (2rem * 3 + 20px))</p>
<div class="container">
<div class="box" style="width: calc(100px + 30% - (2rem * 3 + 20px));"></div>
</div>
<p>calc(100px + 30% - (120px / (2*4 + 3 )))</p>
<div class="container">
<div class="box" style="width: calc(100px + 30% - (120px / (2*4 + 3 )));"></div>
</div>
<p>calc(50% + 60px)</p>
<div class="container">
<div class="box" style="width: calc(50% + 60px);"></div>
</div>
<p>calc(50% - 60px)</p>
<div class="container">
<div class="box" style="width: calc(50% - 60px);"></div>
</div>
<p>calc(50% + -60px)</p>
<div class="container">
<div class="box" style="width: calc(50% + -60px);"></div>
</div>
<p>calc(50% + 50px - 10px)</p>
<div class="container">
<div class="box" style="width: calc(50% + 50px - 10px);"></div>
</div>
<p>calc(50% + 3*20px)</p>
<div class="container">
<div class="box" style="width: calc(50% + 3*20px);"></div>
</div>
<p>calc(50% + 3 * 20px)</p>
<div class="container">
<div class="box" style="width: calc(50% + 3 * 20px);"></div>
</div>
<p>calc(50% + 10.5pt)</p>
<div class="container">
<div class="box" style="width: calc(50% + 10.5pt);"></div>
</div>
<p>calc(50% + .5pt)</p>
<div class="container">
<div class="box" style="width: calc(50% + .5pt);"></div>
</div>
</body>
</html>
|