Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /css/css-inline/inline-block-last-baseline-skips-non-contributing-block-in-inline.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<title>CSS Inline: inline-block last baseline skips non-contributing block-in-inline child</title>
<link rel="match" href="inline-block-last-baseline-skips-non-contributing-block-in-inline-ref.html">
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
<meta name="assert" content="An inline-block's last baseline is taken from the last in-flow block-level child that contributes a baseline set (css-align-3 ยง11.5). A block-in-inline whose only content is a single empty block contributes no baseline set, so the inline-block's last baseline must come from the previous in-flow block-level child instead.">
<style>
.test {
font: 20px/1 Ahem;
color: green;
}
.ib {
display: inline-block;
}
.ib p {
margin: 50px 0;
background: green;
}
.empty {
display: block;
width: 60px;
height: 30px;
background: green;
}
</style>
<p>Test passes if there is one solid green shape with a green "X" baseline-aligned to the green letter inside it.</p>
<div class="test"><div class="ib"><p>P</p><div><span><div class="empty"></div></span></div></div>X</div>