| OLD | NEW |
| (Empty) | |
| 1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/st
rict.dtd"> |
| 2 |
| 3 <html> |
| 4 |
| 5 <head> |
| 6 |
| 7 <meta http-equiv="content-type" content="text/html; charset=UTF-8"> |
| 8 |
| 9 <title>Embedded HTML document for abs-pos-non-replaced-icb-vlr-015 in 'writing
-mode: vertical-lr'</title> |
| 10 |
| 11 <!-- |
| 12 position absolute and 'vertical-rl' - 'width' and 'right' are 'auto' and 'left
' is not 'auto' with 'direction: ltr' in initial containing block |
| 13 --> |
| 14 |
| 15 <style type="text/css"> |
| 16 html |
| 17 { |
| 18 direction: ltr; |
| 19 } |
| 20 |
| 21 div |
| 22 { |
| 23 border-left: green solid 25px; |
| 24 border-right: green solid 75px; |
| 25 height: 100px; |
| 26 left: 60%; |
| 27 position: absolute; |
| 28 right: auto; |
| 29 top: 0px; |
| 30 width: auto; |
| 31 -webkit-writing-mode: vertical-lr; |
| 32 } |
| 33 |
| 34 /* |
| 35 " |
| 36 3. [If] 'width' and 'right' are 'auto' and 'left' is not 'auto', then the widt
h is shrink-to-fit. Then solve for 'right' |
| 37 " |
| 38 10.3.7 Absolutely positioned, non-replaced elements |
| 39 http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width |
| 40 |
| 41 So: |
| 42 |
| 43 60% : left |
| 44 + |
| 45 0px : margin-left |
| 46 + |
| 47 25px : border-left-width |
| 48 + |
| 49 0px : padding-left |
| 50 + |
| 51 auto : width (set to shrink-to-fit) |
| 52 + |
| 53 0px : padding-right |
| 54 + |
| 55 75px : border-right-width |
| 56 + |
| 57 0px : margin-right |
| 58 + |
| 59 solve : right |
| 60 ==================== |
| 61 500px : width of containing block (width of Initial Containing Block) |
| 62 |
| 63 becomes |
| 64 |
| 65 300px : left (60% of 500px == 300px) |
| 66 + |
| 67 0px : margin-left |
| 68 + |
| 69 25px : border-left-width |
| 70 + |
| 71 0px : padding-left |
| 72 + |
| 73 0px : width (shrink-to-fit) |
| 74 + |
| 75 0px : padding-right |
| 76 + |
| 77 75px : border-right-width |
| 78 + |
| 79 0px : margin-right |
| 80 + |
| 81 solve : right |
| 82 ==================== |
| 83 500px : width of containing block (width of Initial Containing Block) |
| 84 |
| 85 so used right offset value must be 100px. |
| 86 |
| 87 */ |
| 88 </style> |
| 89 </head> |
| 90 |
| 91 <body> |
| 92 |
| 93 <div></div> |
| 94 |
| 95 </body> |
| 96 </html> |
| OLD | NEW |