mq-calc-003.html (1076B)
1 <!doctype html> 2 <html> 3 <head> 4 <title>Test: evaluation of ex in calc in Media Queries</title> 5 <link rel="author" title="Florian Rivoal" href="http://florian.rivoal.net/"> 6 <link rel="help" href="http://www.w3.org/TR/css3-values/#calc-notation"> 7 <link rel="help" href="http://www.w3.org/TR/css3-mediaqueries/#units"> 8 <link rel="match" href="../reference/ref-filled-green-100px-square.xht"> 9 <meta name="assert" content="The size in pixels of the 'ex' unit used in calc inside a media query does not depend on declarations and use the initial value."> 10 <style> 11 :root { font-size: 30000px; } 12 p { font-size: 16px; } 13 div { 14 width: 100px; 15 height: 100px; 16 background-color: red; 17 } 18 @media (min-width: calc(1ex)){ 19 div { background-color: green; } 20 } 21 </style> 22 </head> 23 <body> 24 <p>Test passes if there is a filled green square and <strong>no red</strong>.</p> 25 <div></div> 26 <script> 27 document.body.offsetTop; 28 </script> 29 <style> 30 @media (min-width: calc(1ex)){ 31 div { background-color: green; } 32 } 33 </style> 34 </body> 35 </html>