box-offsets-rel-pos-vrl-004.xht (4519B)
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: box offsets - relatively positioned boxes</title> 8 9 <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> 10 <link rel="help" title="7.1 Principles of Layout in Vertical Writing Modes" href="http://www.w3.org/TR/css-writing-modes-3/#vertical-layout" /> 11 <link rel="match" href="box-offsets-rel-pos-vrl-004-ref.xht" /> 12 13 <meta content="image" name="flags" /> 14 <meta content="Box offsets (bottom, left, right, top) expressed in absolute units (not with percentage unit) for relatively positioned boxes are with respect to the edges of the boxes themselves." name="assert" /> 15 16 <style type="text/css"><![CDATA[ 17 html 18 { 19 writing-mode: vertical-rl; 20 } 21 22 div#statically-positioned-box 23 { 24 background-color: yellow; /* padding box will be yellow */ 25 border: orange solid 50px; /* border box will be orange */ 26 height: 100px; /* a bright green square 100px by 100px image will serve as content box */ 27 margin-right: 8px; 28 padding: 50px; 29 position: static; 30 width: 100px; 31 } 32 33 div.blue-relatively-positioned 34 { 35 background-color: blue; 36 color: white; 37 height: 25px; 38 position: relative; 39 width: 25px; 40 writing-mode: horizontal-tb; 41 } 42 43 div#top-left 44 { 45 left: 75px; 46 /* 47 Calculation of left offset: 48 25px (div#top-left's content width) 49 + 50 50px (div#statically-positioned-box's border-left) 51 ================== 52 75px 53 */ 54 55 top: 50px; 56 /* 57 Calculation of top offset: 58 50px (div#statically-positioned-box's border-top) 59 ================== 60 50px 61 */ 62 } 63 64 div#top-right 65 { 66 left: 275px; 67 /* 68 Calculation of left offset: 69 25px (div#top-left's content width) 70 + 71 50px (div#statically-positioned-box's border-left) 72 + 73 200px (div#statically-positioned-box's padding-box) 74 ================== 75 275px 76 */ 77 78 top: 50px; 79 /* 80 Calculation of top offset: 81 50px (div#statically-positioned-box's border-top) 82 ================== 83 50px 84 */ 85 } 86 87 div#bottom-left 88 { 89 top: 225px; 90 /* 91 Calculation of top offset: 92 50px (div#statically-positioned-box's border-top) 93 + 94 200px (div#statically-positioned-box's padding-box height) 95 - 96 25px (div#bottom-left's content height) 97 ================== 98 225px 99 */ 100 101 left: 125px; 102 /* 103 Calculation of left offset: 104 25px (div#top-left's content width) 105 + 106 25px (div#top-right's content width) 107 + 108 25px (div#bottom-left's content width) 109 + 110 50px (div#statically-positioned-box's border-left) 111 ================== 112 125px 113 */ 114 } 115 116 div#bottom-right 117 { 118 top: 225px; 119 /* 120 Calculation of bottom offset: 121 50px (div#statically-positioned-box's border-top) 122 + 123 200px (div#statically-positioned-box's padding-box height) 124 - 125 25px (div#bottom-right's content height) 126 ================== 127 225px 128 */ 129 130 left: 325px; 131 /* 132 Calculation of left offset: 133 25px (div#top-left's content width) 134 + 135 25px (div#top-right's content width) 136 + 137 25px (div#bottom-left's content width) 138 + 139 50px (div#statically-positioned-box's border-left) 140 + 141 200px (div#statically-positioned-box's padding-box) 142 ================== 143 325px 144 */ 145 } 146 ]]></style> 147 148 </head> 149 150 <body> 151 152 <p><img src="support/pass-cdts-box-offsets-rel-pos.png" width="304" height="35" alt="Image download support must be enabled" /></p> 153 154 <!-- 155 The image says: 156 " 157 Test passes if there is a blue square 158 at each corner of the yellow square. 159 " 160 --> 161 162 <div id="statically-positioned-box"><img src="support/100x100-lime.png" alt="Image download support must be enabled" /></div> 163 164 <div class="blue-relatively-positioned" id="top-left">TL</div> 165 166 <div class="blue-relatively-positioned" id="top-right">TR</div> 167 168 <div class="blue-relatively-positioned" id="bottom-left">BL</div> 169 170 <div class="blue-relatively-positioned" id="bottom-right">BR</div> 171 172 </body> 173 </html>