unset-val-001.html (1345B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta charset="utf-8"> 5 <title>CSS Cascade: the "unset" value</title> 6 <link rel="author" title="Chris Rebert" href="http://chrisrebert.com"> 7 <link rel="author" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact"> 8 <link rel="help" href="http://www.w3.org/TR/css-cascade-3/#inherit-initial"> 9 <link rel="help" href="http://www.w3.org/TR/css-cascade-4/#inherit-initial"> 10 <link rel="match" href="reference/ref-filled-green-100px-square.xht"> 11 <meta name="assert" content="color:unset is the same as color:inherit since color is an inherited property. background-color:unset is the same as background-color:initial since background-color is a non-inherited property."> 12 <style> 13 .square { 14 width: 100px; 15 height: 100px; 16 } 17 .under { 18 background-color: green; 19 margin-bottom: -100px; 20 } 21 .outer { 22 color: green; 23 background: red; 24 } 25 .inner { 26 color: red; 27 background-color: red; 28 font-size: 40px; 29 text-align: center; 30 } 31 .inner { 32 color: unset;/* inherit from .outer */ 33 background-color: unset;/* initial, transparent, .under shows thru */ 34 } 35 </style> 36 </head> 37 <body> 38 <p>Test passes if there is a filled green square and <strong>no red</strong>.</p> 39 40 <div class="outer square"> 41 <div class="under square"></div> 42 <div class="inner square">XX</div> 43 </div> 44 </body> 45 </html>