percent-margin-vrl-002.xht (2242B)
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 2 3 <html xmlns="http://www.w3.org/1999/xhtml"> 4 5 <head> 6 7 <title>CSS Writing Modes Test: margin percentage and 'vertical-rl' (orthogonal flow)</title> 8 9 <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> 10 <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#dimension-mapping" title="7.2 Dimensional Mapping" /> 11 <link rel="match" href="margin-vrl-002-ref.xht" /> 12 13 <meta content="image" name="flags" /> 14 <meta content="This test checks that percentages on the margin are calculated with respect to the width (inline-size) of the containing block if 'writing-mode' of such containing block is 'horizontal-tb'. In this test, div.outer's computed 'writing-mode' value is 'horizontal-tb' and it is the div.inner's containing block." name="assert" /> 15 16 <style type="text/css"><![CDATA[ 17 div.outer 18 { 19 background-color: blue; 20 border: blue solid 3px; 21 width: 200px; 22 } 23 24 div.inner 25 { 26 background-color: yellow; 27 height: 50px; 28 width: 50px; 29 writing-mode: vertical-rl; 30 } 31 32 div.foo 33 { 34 margin-bottom: 2.5%; /* 5px ; collapses with hr's margin-top */ 35 margin-left: 50%; /* 100px */ 36 margin-right: 25%; /* 50px */ 37 margin-top: 10%; /* 20px */ 38 } 39 40 hr 41 { 42 background-color: transparent; 43 border: transparent none 0px; 44 height: 3px; 45 margin: 0.5em auto; 46 } 47 48 div.bar 49 { 50 margin-bottom: 10%; /* 20px */ 51 margin-left: 25%; /* 50px */ 52 margin-right: 50%; /* 100px */ 53 margin-top: 2.5%; /* 5px ; collapses with hr's margin-bottom */ 54 } 55 56 div#reference 57 { 58 margin-top: 1em; 59 } 60 ]]></style> 61 </head> 62 63 <body> 64 65 <p>Test passes if there are 2 <strong>identical</strong> blue rectangles, each with 2 small yellow squares: the layout must be identical.</p> 66 67 <div class="outer"> 68 <div class="inner foo"></div> 69 <hr /> 70 <div class="inner bar"></div> 71 </div> 72 73 <div id="reference"><img src="support/blue-yellow-206w-165h.png" width="206" height="165" alt="Image download support must be enabled" /></div> 74 75 </body> 76 </html>