-
Notifications
You must be signed in to change notification settings - Fork 14
/
calc.html
60 lines (57 loc) · 1.43 KB
/
calc.html
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
<!DOCTYPE html>
<html>
<head>
<title>Calculation</title>
<style type="text/css" media="all">
ol {margin: 0; padding: 0;}
li {margin: 1em 0 1em 2em; padding: 25px 0 10px;
font: 1em Times, serif; width: 1000px;
white-space: nowrap;
background: #FAA url(i/ruler.png) repeat-x;}
div {padding: 25px 0 10px 0; text-align: center;
background: #AEA url(i/ruler.png) repeat-x;}
#d1 {
width: -webkit-calc(100% - 200px);
width: -moz-calc(100% - 200px);
width: calc(100% - 200px);
}
#d2 {
width: -webkit-calc(100px / 2 * 3);
width: -moz-calc(100px / 2 * 3);
width: -ms-calc(100px / 2 * 3);
width: -o-calc(100px / 2 * 3);
width: calc(100px / 2 * 3);
}
#l1 {
width: -webkit-calc(100px / 2 * 3);
width: -moz-calc(100px / 2 * 3);
width: -ms-calc(100px / 2 * 3);
width: -o-calc(100px / 2 * 3);
width: calc(100px / 2 * 3);
}
#l2 {
width: -webkit-calc((100px / 2) * 3);
width: -moz-calc((100px / 2) * 3);
width: -ms-calc((100px / 2) * 3);
width: -o-calc((100px / 2) * 3);
width: calc((100px / 2) * 3);
}
#l3 {
width: -webkit-calc(100px / (2 * 3));
width: -moz-calc(100px / (2 * 3));
width: -ms-calc(100px / (2 * 3));
width: -o-calc(100px / (2 * 3));
width: calc(100px / (2 * 3));
}
</style>
</head>
<body>
<div>Testing div with width of 100%</div>
<div id="d1">Testing div with width of (100% - 200px)</div>
<ol>
<li id="l1">calc(100px / 2 * 3)</li>
<li id="l2">calc((100px / 2) * 3)</li>
<li id="l3">calc(100px / (2 * 3))</li>
</ol>
</body>
</html>