-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Expand file tree
/
Copy pathbackground-color-computed.html
More file actions
30 lines (29 loc) · 1.08 KB
/
background-color-computed.html
File metadata and controls
30 lines (29 loc) · 1.08 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Backgrounds and Borders: getComputedStyle().backgroundColor</title>
<link rel="help" href="https://un5n798jx6qx6j0rmf2verhh.julianrbryant.com/css-backgrounds/#background-color">
<meta name="assert" content="background-color computed value is a computed color.">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/computed-testcommon.js"></script>
<style>
#target {
color: lime;
}
</style>
</head>
<body>
<div id="target"></div>
<script>
test_computed_value("background-color", "currentcolor", "rgb(0, 255, 0)");
test_computed_value("background-color", "red", "rgb(255, 0, 0)");
test_computed_value("background-color", "#00FF00", "rgb(0, 255, 0)");
test_computed_value("background-color", "rgb(0, 0, 255)");
test_computed_value("background-color", "rgb(100%, 100%, 0%)", "rgb(255, 255, 0)");
test_computed_value("background-color", "hsl(120, 100%, 50%)", "rgb(0, 255, 0)");
test_computed_value("background-color", "transparent", "rgba(0, 0, 0, 0)");
</script>
</body>
</html>