| OLD | NEW |
| (Empty) |
| 1 <!doctype html> | |
| 2 <html> | |
| 3 <head> | |
| 4 <style> | |
| 5 body { | |
| 6 font-family: monospace; | |
| 7 } | |
| 8 p { | |
| 9 margin: 0; | |
| 10 } | |
| 11 | |
| 12 .container { | |
| 13 width: 13em; | |
| 14 height: 10em; | |
| 15 background-color: lightgray; | |
| 16 } | |
| 17 | |
| 18 .light { | |
| 19 background-color: lightgreen; | |
| 20 } | |
| 21 | |
| 22 .lime { | |
| 23 background-color: lime; | |
| 24 } | |
| 25 | |
| 26 .green { | |
| 27 background-color: green; | |
| 28 } | |
| 29 </style> | |
| 30 </head> | |
| 31 <body> | |
| 32 Partial overlap, @region more specific than <style scoped> (@regio
n style has rules for class and id, scoped style has rule for <p>) | |
| 33 <div class='container' id='r1'> | |
| 34 <p class='light'>Styled line of text</p> | |
| 35 <p class='light'>Styled line of text</p> | |
| 36 <p class='light'>Styled line of text</p> | |
| 37 </div> | |
| 38 Partial overlap, <style scoped> more specific than @region (@regio
n style has rule for <p>, scoped style has rules for class and id) | |
| 39 <div class='container' id='r2'> | |
| 40 <p class='light'>Styled line of text</p> | |
| 41 <p class='lime'>Styled line of text</p> | |
| 42 <p class='green'>Styled line of text</p> | |
| 43 </div> | |
| 44 Overlap, @region and <style scoped>using the same selectors (both
@region and scoped style have rules for <p>, class and id) | |
| 45 <div class='container' id='r3'> | |
| 46 <p class='light'>Styled line of text</p> | |
| 47 <p class='lime'>Styled line of text</p> | |
| 48 <p class='green'>Styled line of text</p> | |
| 49 </div> | |
| 50 </body> | |
| 51 </html> | |
| OLD | NEW |