Source code
Revision control
Copy as Markdown
Other Tools
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Embedded HTML document for abs-pos-non-replaced-icb-vrl-006 in 'writing-mode: vertical-rl'</title>
  <!--
  position absolute and 'vertical-rl' - 'left' and 'width' are 'auto', 'right' is not 'auto' with 'direction: ltr' in initial containing block
  -->
  <style type="text/css">
  html
    {
      direction: ltr;
    }
  div
    {
      border-left: green solid 25px;
      border-right: green solid 75px;
      height: 100px;
      left: auto;
      position: absolute;
      right: 80%;
      top: 0px;
      width: auto;
      writing-mode: vertical-rl;
    }
  /*
  "
  1. [If] 'left' and 'width' are 'auto' and 'right' is not 'auto', then the width is shrink-to-fit. Then solve for 'left'
  "
  10.3.7 Absolutely positioned, non-replaced elements
  So:
           auto : left
        +
            0px : margin-left
        +
           25px : border-left-width
        +
            0px : padding-left
        +
           auto : width
        +
            0px : padding-right
        +
           75px : border-right-width
        +
            0px : margin-right
        +
            80% : right
        ====================
          500px : width of containing block (width of Initial Containing Block)
  becomes
        (solve) : left
        +
            0px : margin-left
        +
           25px : border-left-width
        +
            0px : padding-left
        +
            0px : width (shrink-to-fit)
        +
            0px : padding-right
        +
           75px : border-right-width
        +
            0px : margin-right
        +
          400px : right (80% of 500px == 400px)
        ====================
          500px : width of containing block (width of Initial Containing Block)
   so used left offset value must be 0px .
  */
  </style>
 </head>
 <body>
  <div></div>
 </body>
</html>