Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /css/css-position/position-absolute-dynamic-relayout-006.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<title>CSS Positioned Test: an absolutely positioned element whose containing block is an inline element resolves its percentage width correctly after revealing itself via display:block</title>
<link rel="author" title="Ting-Yu Lin" href="mailto:tlin@mozilla.com">
<link rel="match" href="../reference/ref-filled-green-100px-square.xht">
<style>
#absCB {
position: relative;
}
#abs {
position: absolute;
width: 80%;
background: red;
display: none;
}
#green {
width: 100px;
height: 100px;
background: green;
}
</style>
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
<span id="absCB">
<div>
<div id="abs"><div id="green"></div></div>
</div>
</span>
<script>
document.documentElement.offsetTop;
abs.style.display = "block";
</script>