Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /css/css-values/calc-positive-fraction-001.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<meta charset="UTF-8">
<title>CSS Test: calc() with positive fraction halfway between adjacent integers</title>
<link rel="author" title="GĂ©rard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/">
<link rel="match" href="../reference/ref-filled-green-100px-square.xht">
<style>
div
{
height: 100px;
position: absolute;
width: 100px;
}
div#red-overlapped
{
background-color: red;
z-index: 2;
}
div#green-overlapping
{
background-color: green;
z-index: calc(3 / 2);
/*
should resolve to 'z-index: 2' since "values
halfway between adjacent integers rounded
towards positive infinity" and since
div#green-overlapping is last in document
tree order, then it should overlap
div#red-overlapped
*/
}
</style>
<p>Test passes if there is a filled green square and <strong>no red</strong>.
<div id="red-overlapped"></div>
<div id="green-overlapping"></div>