tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

embedded-doc-abs-pos-non-replaced-icb-vrl-008.html (2100B)


      1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.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-vrl-008 in 'writing-mode: vertical-rl'</title>
     10 
     11  <!--
     12  position absolute and 'vertical-rl' - 'left' and 'width' are 'auto', 'right' is not 'auto' with 'direction: rtl' in initial containing block
     13  -->
     14 
     15  <style type="text/css">
     16  html
     17    {
     18      direction: rtl;
     19    }
     20 
     21  div
     22    {
     23      border-left: green solid 25px;
     24      border-right: green solid 75px;
     25      height: 100px;
     26      left: auto;
     27      position: absolute;
     28      right: 20%;
     29      top: 0px;
     30      width: auto;
     31      writing-mode: vertical-rl;
     32    }
     33 
     34  /*
     35  "
     36  1. [If] 'left' and 'width' are 'auto' and 'right' is not 'auto', then the width is shrink-to-fit. Then solve for 'left'
     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           auto : left
     44        +
     45            0px : margin-left
     46        +
     47           25px : border-left-width
     48        +
     49            0px : padding-left
     50        +
     51           auto : width
     52        +
     53            0px : padding-right
     54        +
     55           75px : border-right-width
     56        +
     57            0px : margin-right
     58        +
     59            20% : right
     60        ====================
     61          500px : width of containing block (width of Initial Containing Block)
     62 
     63  becomes
     64 
     65        (solve) : left
     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          100px : right (20% of 500px == 100px)
     82        ====================
     83          500px : width of containing block (width of Initial Containing Block)
     84 
     85   so used left offset value must be 300px .
     86 
     87  */
     88  </style>
     89 </head>
     90 
     91 <body>
     92 
     93  <div></div>
     94 
     95 </body>
     96 </html>