multicol-nested-margin-001.xht (1736B)
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 2 <html xmlns="http://www.w3.org/1999/xhtml"> 3 <head> 4 <title>CSS Multi-column Layout Test: multicolumn and nested margins</title> 5 <link rel="author" title="Opera Software ASA" href="http://www.opera.com/" /> 6 <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2013-08-11 --> 7 <link rel="help" href="http://www.w3.org/TR/css3-multicol/#pagination-and-overflow-outside-multicol" title="8.2. Pagination and overflow outside multicol elements" /> 8 <link rel="match" href="multicol-nested-margin-001-ref.xht" /> 9 <meta name="flags" content="ahem" /> 10 <meta name="assert" content="This test checks that non-zero vertical margins can be applied on a multi-column element while the vertical margins of its own block containers can be set to zero." /> 11 <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" /> 12 <style type="text/css"><![CDATA[ 13 body {margin: 0em;} 14 15 body > div 16 { 17 font: 1.25em/1 Ahem; 18 width: 32em; 19 20 column-count: 3; 21 column-gap: 1em; 22 } 23 24 /* 25 26 N == 3; 27 28 W == ((available-width + column-gap) / N) - column-gap; 29 W == ((32em + 1em) / 3) - 1em; 30 W == (33em / 3) - 1em; 31 W == (11em) - 1em; 32 W == 10em; 33 34 */ 35 36 div 37 { 38 background: yellow; 39 color: black; 40 margin: 1em; 41 orphans: 1; 42 widows: 1; 43 } 44 45 div > div {margin: 0em 1em;} 46 47 div div:nth-child(2) {color: pink;} 48 49 div div:nth-child(3) {color: blue;} 50 ]]></style> 51 </head> 52 53 <body> 54 55 <div> 56 <div> 57 bl ac 58 bl ac 59 bl ac 60 bl ac 61 </div> 62 <div> 63 Pi nk 64 Pi nk 65 Pi nk 66 Pi nk 67 </div> 68 <div> 69 bl ue 70 bl ue 71 bl ue 72 bl ue 73 </div> 74 </div> 75 76 </body> 77 </html>