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/max-length-percent-001.html - WPT Dashboard Interop Dashboard
<!doctype html>
<meta charset="utf-8">
<title>CSS values: max() between pixel and percentage values</title>
<link rel="match" href="reference/200-200-green.html">
<link rel="author" title="Xiaocheng Hu" href="mailto:xiaochengh@chromium.org">
<style>
html, body { margin: 0px; padding: 0px; }
#parent { width: 400px; }
#target {
width: max(100px, 25% + 100px, 150px + 10%);
height: 200px;
background: green;
}
#fail {
width: 200px;
height: 200px;
position: absolute;
z-index: -1;
background: red;
}
</style>
<div id=parent>
<div id=fail></div>
<div id=target></div>
</div>