margin-collapse-vrl-036.xht (2138B)
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: 'vertical-rl' and margin collapsing - left margin of a block collapses with left margin of its last child</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/#logical-direction-layout" title="7.4 Flow-Relative Mappings" /> 11 <link rel="match" href="../reference/ref-filled-green-100px-square.xht" /> 12 13 <!-- 14 " 15 The margin collapsing rules apply exactly with the block-start margin substituted for the top margin and the block-end margin substituted for the bottom margin. 16 " 17 --> 18 19 <meta content="ahem image" name="flags" /> 20 <meta name="assert" content="This test checks that, in a vertical-rl context, the left margin an in-flow block box collapses with its last in-flow block-level child's left margin if the element has no left padding and no left border and the child's left margin does not collapse with a right margin that has clearance." /> 21 22 <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" /> 23 <style type="text/css"><![CDATA[ 24 div 25 { 26 font: 25px/1em Ahem; 27 height: 4em; 28 } 29 30 div#wrapper 31 { 32 background: red url("support/margin-collapse-2em-space-wm-vert.png"); 33 border-right: green solid 1em; 34 width: 3em; 35 writing-mode: vertical-rl; 36 } 37 38 div#parent 39 { 40 background-color: green; 41 margin-left: 2em; /* block-end margin */ 42 } 43 44 div#last-child 45 { 46 margin-left: 2em; /* block-end margin of last child */ 47 } 48 49 div#following-parent 50 { 51 background-color: green; 52 width: 1em; 53 } 54 ]]></style> 55 56 </head> 57 58 <body> 59 60 <p>Test passes if there is a filled green square and <strong>no red</strong>.</p> 61 62 <div id="wrapper"> 63 <div id="parent"> 64 <div id="widthless-child"></div> 65 <div id="last-child"></div> 66 </div> 67 <div id="following-parent"></div> 68 </div> 69 70 </body> 71 </html>