css3-selectors-lang-024.html (1346B)
1 <!DOCTYPE html> 2 <html lang="en" > 3 <head> 4 <meta charset="utf-8"/> 5 <title>[lang|="es"], lang="ES"</title> 6 <link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'> 7 <link rel='help' href='http://www.w3.org/TR/css3-selectors/#attribute-selectors'> 8 <script src="/resources/testharness.js"></script> 9 <script src="/resources/testharnessreport.js"></script> 10 <meta name='flags' content='HTMLonly'> 11 <style type='text/css'> 12 .test div { width: 50px; } 13 #colonlangcontroltest { color: red; font-weight: bold; width: 400px; } 14 #colonlangcontroltest[lang|=xx] { display:none; } 15 #box[lang|='es'] { width: 100px; } 16 #relevance[lang|='yy'] { display:none; } 17 </style> 18 </head> 19 <body> 20 21 22 23 <div class="test"><div id="box" lang="ES"> </div></div> 24 <p lang='xx' id='colonlangcontroltest'>This test failed because it relies on [lang|=..] for results, but [lang|=..] is not supported by this browser. 25 26 27 <!--Notes: 28 This tests a detail related to [lang|=..] support. If [lang|=..] is not supported, a message will appear and the test will fail. 29 --> 30 <script> 31 test(function() { 32 assert_equals(document.getElementById('colonlangcontroltest').offsetWidth, 0) 33 assert_equals(document.getElementById('box').offsetWidth, 100); 34 }, "A lang|= value will match a lang attribute value regardless of case differences."); 35 </script> 36 37 <div id='log'></div> 38 39 </body> 40 </html>