concept
initial-containing-block — CSS reference
In continuous media its dimensions correspond to the viewport and it is anchored at the canvas origin. When no ancestor establishes an absolute-position containing block, an absolute box uses it. Unlike a viewport-fixed box, that absolute box scrolls with the document.
Formal Syntax & Structure
css syntaxcss
Initial containing block (concept).Working Example
Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>CSS positioning lab</title><style>body {margin:0} .sample {background:#dcebe9;color:#182e32}#p{width:240px;height:160px;background:#e6eef2} #a{width:60px;height:30px;background:#128579} #b{height:20px;background:#adcde8}#p{margin:40px}#a{position:absolute;top:10px;left:20px}body{height:1500px}</style><body><div id="p"><div id="a">A</div><div id="b">B</div></div></body></html>