| <!DOCTYPE html> |
| <html> |
| <!-- |
| | This test ensures that an element with a non-positioned stacking context |
| | above its positioned containing block will have its offset from the |
| | containing block calculated correctly. The results should display the blue |
| | block directly under the green block. |
| | https://www.w3.org/TR/CSS21/visudet.html#containing-block-details |
| --> |
| <head> |
| <style> |
| body { |
| font-family: Roboto; |
| font-size: 16px; |
| } |
| .non-positioned-stacking-context { |
| position: static; |
| |
| opacity: .9; |
| |
| width: 300px; |
| height: 50px; |
| margin-left: 40px; |
| } |
| .absolute-container { |
| position: absolute; |
| |
| width: 300px; |
| height: 50px; |
| |
| background-color: rgb(15, 157, 88); |
| } |
| .positioned-element { |
| position: absolute; |
| |
| z-index: 1; |
| |
| width: 300px; |
| height: 20px; |
| top: 60px; |
| |
| background-color: rgb(66, 133, 244); |
| } |
| </style> |
| </head> |
| <body> |
| <div class="non-positioned-stacking-context"> |
| <div class="absolute-container"> |
| <div class="positioned-element"></div> |
| </div> |
| </div> |
| </body> |
| </html> |