| <!DOCTYPE html> | |
| <!-- | |
| | Absolutely positioned elements should have their static position set | |
| | to where they would have appeared if they were layed out within their | |
| | parent element's flow. This test ensures that an absolutely positioned | |
| | element has static position set according to its parent element's flow, not | |
| | its containing block. | |
| --> | |
| <html> | |
| <head> | |
| <style> | |
| .container-block { | |
| position: absolute; | |
| width: 350px; | |
| height: 350px; | |
| background-color: rgb(255, 50, 50); | |
| } | |
| .static-block1 { | |
| position: static; | |
| width: 30%; | |
| height: 30%; | |
| background-color: rgb(0, 100, 255); | |
| } | |
| .static-block2 { | |
| position: static; | |
| width: 30%; | |
| height: 30%; | |
| background-color: rgb(0, 75, 191); | |
| } | |
| .absolute-block { | |
| position: absolute; | |
| width: 30%; | |
| height: 30%; | |
| background-color: rgb(0, 255, 100); | |
| transform: translateX(125px); | |
| } | |
| </style> | |
| </head> | |
| <body> | |
| <div class="container-block"> | |
| <div class="static-block1"> | |
| </div> | |
| <div class="static-block2"> | |
| <div class="static-block1"> | |
| </div> | |
| <div class="static-block1"> | |
| <div class="absolute-block"> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </body> | |
| </html> |