c412-blockw-000.xht (2983B)
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 2 <html xmlns="http://www.w3.org/1999/xhtml"> 3 <head> 4 <title>CSS Test: Horizontal Formatting</title> 5 <meta name="flags" content="ahem image" /> 6 <link rel="help" href="http://www.w3.org/TR/REC-CSS1#horizontal-formatting"/> 7 <link rel="author" title="CSS1 Test Suite Contributors" href="http://www.w3.org/Style/CSS/Test/CSS1/current/tsack.html"/> 8 <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/> 9 <link rel="match" href="c412-blockw-000-ref.xht" /> 10 11 <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" /> 12 <style type="text/css"><![CDATA[ 13 .test { font: 10px/1 Ahem; margin: 1em; border: solid 1em; width: 100px; background: red no-repeat; color: green; } 14 .test p, .test div { margin-top: 0; margin-bottom: 0; } 15 .test.a { background-image: url(support/css1test412b-a.png); } 16 .test.b { background-image: url(support/css1test412b-b.png); } 17 .test.b p { background-color: green; } 18 p.one {margin-left: 10px;} 19 div.two {margin-left: 10px;} 20 p.three {margin-left: 0; width: 50%; margin-right: auto;} 21 p.four {margin-left: auto; width: 50%; margin-right: auto;} 22 p.five {margin-left: auto; width: 50%; margin-right: 0;} 23 p.six {margin-left: auto; width: auto; margin-right: 0;} 24 p.seven {margin-left: 0; width: auto; margin-right: auto;} 25 p.eight {margin-left: auto; width: auto; margin-right: auto;} 26 p.nine {padding-left: 0; padding-right: 0; margin-left: 0; margin-right: 0; width: 50%;} 27 p.ten {margin-left: auto; width: 100%; margin-right: auto;} 28 ]]></style> 29 <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#blockwidth" title="10.3.3 Block-level, non-replaced elements in normal flow"/> 30 <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#the-width-property" title="10.2 Content width: the 'width' property"/> 31 <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#margin-properties" title="8.3 Margin properties: 'margin-top', 'margin-right', 'margin-bottom', 'margin-left', and 'margin'"/> 32 </head> 33 <body> 34 <p>Test passes if there are 2 identical filled green squares and <strong>no red</strong>.</p> 35 <div class="test a"> <!-- this tests the text alignment --> 36 <p class="one"> X </p> 37 <div class="two"> 38 <p class="one"> X </p> 39 </div> 40 <p class="three"> X </p> 41 <p class="four"> X </p> 42 <p class="five"> X </p> 43 <p class="six"> X </p> 44 <p class="seven"> X </p> 45 <p class="eight"> X </p> 46 <p class="nine"> X </p> 47 <p class="ten"> X </p> 48 </div> 49 <div class="test b"> <!-- this tests the size of the content area --> 50 <p class="one"> X </p> 51 <div class="two"> 52 <p class="one"> X </p> 53 </div> 54 <p class="three"> X </p> 55 <p class="four"> X </p> 56 <p class="five"> X </p> 57 <p class="six"> X </p> 58 <p class="seven"> X </p> 59 <p class="eight"> X </p> 60 <p class="nine"> X </p> 61 <p class="ten"> X </p> 62 </div> 63 </body> 64 </html>