Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
30 lines (30 loc) · 1.51 KB

File metadata and controls

30 lines (30 loc) · 1.51 KB
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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 PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>ID selectors</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style type="text/css"><![CDATA[li { background-color : red }
#t1 { background-color : lime }
li#t2 { background-color : lime }
li#t3 { background-color : lime }
#t4 { background-color : red }]]></style>
<link rel="author" title="Daniel Glazman" href="http://glazman.org/"/>
<link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/>
<link rel="help" href="https://www.w3.org/TR/css3-selectors/#selectors"/> <!-- bogus link to make sure it gets found -->
</head>
<body>
<ul>
<li id="t1">This list item should have a green background. because its ID is &quot;t1&quot;</li>
<li id="t2">This list item should have a green background. because its ID is &quot;t2&quot;</li>
<li id="t3"><span id="t44">This list item should have a green background. because the inner SPAN does not match &quot;#t4&quot;</span></li>
</ul>
<script><![CDATA[
test(function() {
assert_equals(getComputedStyle(document.getElementById('t1')).backgroundColor, 'rgb(0, 255, 0)');
assert_equals(getComputedStyle(document.getElementById('t2')).backgroundColor, 'rgb(0, 255, 0)');
assert_equals(getComputedStyle(document.getElementById('t3')).backgroundColor, 'rgb(0, 255, 0)');
}, "ID selectors match correctly");
]]></script>
</body>
</html>
Morty Proxy This is a proxified and sanitized view of the page, visit original site.