Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /css/css-grid/grid-model/grid-item-first-line-002.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Grid Layout Test: '::first-line' line-height contributes to the size of a grid item's row</title>
<link rel="author" title="Sammy Gill" href="mailto:sammy.gill@apple.com">
<link rel="match" href="../../reference/ref-filled-green-100px-square.xht">
<meta name="assert" content="This test checks that the line-height from a grid item's '::first-line' pseudo-element contributes to the size of the row it is in, so that a stretched sibling in the same row is sized by it.">
<style>
#reference-overlapped-red {
width: 100px;
height: 100px;
background-color: red;
}
.grid {
display: grid;
grid-template-columns: 50px 50px;
margin-top: -100px;
}
.item {
color: transparent;
background-color: green;
}
.tall-first-line::first-line {
line-height: 100px;
}
</style>
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
<div id="reference-overlapped-red"></div>
<div class="grid">
<div class="item tall-first-line">X</div>
<div class="item">X</div>
</div>