summaryrefslogtreecommitdiff
path: root/Base/home/anon/www/selectors.html
blob: aced2f9cd3331d1a7a6def0e9badc42ac4b0529e (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
<html>
<head>
<title>Selector test</title>
<style>
#foo #bar #baz {
    background-color: lime;
}
.abc .def div {
    background-color: white;
    border-style: solid;
    border-width: 1;
    border-color: lime;
}
div > .boo > .bee {
    background-color: black;
    color: magenta;
}
#gen_sib ~ div,
#adj_sib + div {
    background-color: blue;
    color: white;
}
</style>
</head>
<body>
    <div id="foo">
        <div id="bar">
            <div id="baz">
                I should have a green background.
            </div>
        </div>
    </div>
    <div class="abc">
        <div class="def">
            <div>hello</div>
            <div>hello</div>
            <div>hello</div>
        </div>
    </div>
    <div>
        <div class="boo">
            <div class="bee">Spooky!</div>
        </div>
    </div>
    <div>
        <div class="boo">
            <div>
                <div class="bee">
                    Not spooky!
                </div>
            </div>
        </div>
    </div>
    <div>
        <div id="gen_sib">All the siblings of this &lt;div&gt; should be blue.</div>
        <div>First sibling (should be blue)</div>
        <div>Second sibling (should be blue)</div>
    </div>
    <div>
        <div id="adj_sib">The first sibling of this &lt;div&gt; should be blue.</div>
        <div>First sibling (should be blue)</div>
        <div>Second sibling (should not be blue)</div>
    </div>
</body>
</html>