We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a001649 commit 6b55796Copy full SHA for 6b55796
CSS Variables/percentage-variable.html
@@ -0,0 +1,25 @@
1
+<!DOCTYPE html>
2
+<html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta http-equiv="X-UA-Compatible" content="IE=edge" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+
8
+ <title>Variables with calc</title>
9
+ <style>
10
+ div {
11
+ background-color: blue;
12
+ width: 100%;
13
+ height: 50px;
14
15
+ --percentage: 30;
16
+ width: calc(var(--percentage) * 1%);
17
+ /* width: calc(var(--percentage) * 1rem); */
18
+ }
19
+ </style>
20
+ </head>
21
22
+ <body>
23
+ <div></div>
24
+ </body>
25
+</html>
0 commit comments