Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /css/CSS2/fonts/font-size-124.xht - WPT Dashboard Interop Dashboard
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<head>
<title>CSS Test: inheritance of computed font-size across fonts</title>
<!--
Inspired by
-->
<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" />
<meta content="ahem" name="flags" />
<meta content="ex unit is the 'x-height' of the relevant font. 'em' and 'ex' length values when defining 'font-size' property refer to the computed font size of the parent element." name="assert" />
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
<style type="text/css"><![CDATA[
div#overlapped-red
{
background-color: red;
height: 100px;
width: 100px;
}
div#grand-parent {font: 25px/1 Ahem;}
/*
To download Ahem font:
*/
div#parent {font-size: 5ex;}
/* The Ahem font has an x-height of 0.8em. */
div#overlapping-green
{
background-color: green;
bottom: 100px;
font-family: serif;
position: relative;
width: 100px;
}
/*
In this test, the inherited computed font-size of
div#overlapping-green should be 100px with a line box
height of 100px.
*/
]]></style>
</head>
<body>
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
<div id="overlapped-red"></div>
<div id="grand-parent">
<div id="parent">
<div id="overlapping-green"> </div>
</div>
</div>
</body>
</html>