4 <title>CSS Child selector emulation for IE
6</title>
7 body { background-color: #CCC; }
8 table { border:
1px black solid; }
10 background-color: #
98fb98;
11 border:
1px solid #
40FF40;
18 border: 1px red solid;
19 background-color:white;
24 background-color: #ffc0cb;
27 /** second table. Try to emulate child selector */
30 border: 1px red solid;
31 background-color:white;
36 background-color: #ffc0cb;
39 /** Reset style applied in childemu classes */
40 /** TODO: find the real default value!! */
41 table.childemu tr * th,
42 table.childemu tr * td {
44 background-color: transparent;
49 /** child selector emulation */
54 The following table show how nested tables inherit colors from the wikitable class (here it was renamed "global
").
56 <table class="global
">
57 <caption>Global table</caption>
59 <th>TH: should have pink bg</th>
66 <table class="nested
">
67 <caption>Nested table</caption>
69 <th>Nested TH: transparent</th>
70 <td>Nested TD: transparent</td>
78 With child selector we could limit the wikitable styling to the direct childs of the table. Unfortunately, Internet Explorer 6.0 does not support child selector. See <a href="https://bugzilla.wikimedia.org/show_bug.cgi?id=
33752">our bug #33752</a>.
80 <table class="childemu
">
81 <caption>Global table</caption>
83 <th>TH: should have pink bg</th>
90 <table class="nested
">
91 <caption>Nested table</caption>
93 <th>Nested TH: transparent</th>
94 <td>Nested TD: transparent</td>
100 <p><strong>NOTE:</strong>The nested caption keep the green background. The nested table keep the black border. This is because those declarations are global so we did not reset them.</p>