Source code
Revision control
Copy as Markdown
Other Tools
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Test: Dynamic change to the inline-size of body</title>
<link rel="author" title="Ting-Yu Lin" href="mailto:tlin@mozilla.com">
<link rel="stylesheet" href="/fonts/ahem.css">
<style>
body {
inline-size: 200px;
}
.abs {
position: absolute;
background: green;
inline-size: 100px;
padding-top: 100px;
}
.layout {
font: 50px/1 Ahem;
color: red;
background-color: red;
width: 100px;
padding-top: 25%; /* This resolves against body's inline-size. */
}
</style>
<body>
<div class="abs"></div>
<div class="layout">XX</div>
</body>