| <!DOCTYPE html> |
| <!-- |
| | This test checks that percentage values used for left/top on relatively |
| | positioned elements is calculated relative to the element's parent |
| | element (and not, for example, an absolute containing block). |
| | https://www.w3.org/TR/CSS21/visuren.html#relative-positioning |
| --> |
| <html> |
| <head> |
| <style> |
| .container { |
| width: 100px; |
| height: 150px; |
| |
| background-color: rgb(100, 255, 100); |
| } |
| .box { |
| width: 50px; |
| height: 50px; |
| |
| background-color: rgb(100, 100, 255); |
| } |
| |
| .position-relative { |
| position: relative; |
| left: 25px; |
| top: 25px; |
| |
| background-color: rgb(255, 100, 100); |
| } |
| </style> |
| </head> |
| |
| <body> |
| <div class="container"> |
| <div class="box"></div> |
| <div class="box position-relative"></div> |
| <div class="box"></div> |
| </div> |
| </body> |
| </html> |