OLD | NEW |
---|---|
(Empty) | |
1 <!DOCTYPE HTML> | |
2 <html> | |
3 <head> | |
rune
2015/05/04 08:32:48
Drop html, head, and body tags.
| |
4 <style type="text/css"> | |
5 :nth-child(2){color:red;} | |
6 :nth-of-type(2){color:green;} | |
7 p:nth-child(2n){color:blue;} | |
8 div:nth-of-type(2n+1){color:yellow;} | |
9 </style> | |
10 </head> | |
11 <body> | |
12 <div> | |
13 <p> | |
14 This should be yellow, as this will inherit property of div. | |
15 </p> | |
16 <p> | |
17 This should be blue, as this is even child of type p. | |
18 </p> | |
19 <p> | |
20 This should be yellow, as this will inherit property of div. | |
21 </p> | |
22 <div> | |
23 This should be yellow, as it odd child of its own type. | |
24 </div> | |
25 </div> | |
26 <div> | |
27 This should be green, as this is 2nd child of its own type. | |
28 <p> | |
29 This should be green, as this will inherit property of div. | |
30 </p> | |
31 <p> | |
32 This should be blue, as this is the even child of div. | |
33 </p> | |
34 <p> | |
35 This should be green, as this is the odd child of its own type. | |
36 </p> | |
37 <p> | |
38 This should be blue, as this is the even child of paragraph. | |
39 </p> | |
40 </div> | |
41 <div> | |
42 This should be yellow, as this odd child of its own type. | |
43 <p> | |
44 This should be yellow,as this inherit property of div. | |
45 </p> | |
46 <span>This should be red,as this is the second child of div </span> | |
47 <span>This should be green, as this is the second child of its own type </span> | |
48 <div> | |
49 <span>This should be yellow,as this will inherit property of div i.e yellow as odd of its own type <i>and </i> <i>this should be green and italic </ i></span> | |
50 </div> | |
51 </div> | |
52 </body> | |
53 </html> | |
OLD | NEW |