mirror of
https://github.com/servo/servo
synced 2026-04-28 18:37:39 +02:00
68 lines
2.2 KiB
HTML
68 lines
2.2 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
|
|
<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
|
|
|
<title>CSS Test: Margin collapsing - margins of a 'collapsed through' box without clearance can collapse with parent block's bottom margin</title>
|
|
<style type="text/css">
|
|
@page { font: italic 8pt sans-serif; color: gray;
|
|
margin: 7%;
|
|
counter-increment: page;
|
|
@top-left { content: "CSS 2.1 Conformance Test Suite"; }
|
|
@top-right { content: "Test margin-collapse-clear-016"; }
|
|
@bottom-right { content: counter(page); }
|
|
}
|
|
</style>
|
|
|
|
<link rel="help" href="http://www.w3.org/TR/CSS21/box.html#collapsing-margins" />
|
|
<link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
|
|
<link rel="author" title="Daniel Schattenkirchner" href="crazy-daniel{at}gmx.de" />
|
|
<link rel="match" href="reference/margin-collapse-clear-016-ref.xht" />
|
|
|
|
<meta content="An element that does not have clearance applied to it can collapse its top margin with its parent block's bottom margin. Margins of a 'collapsed through' box without clearance applied to it can collapse with its parent block's bottom margin. An element with clear set to it (to other than 'none') can only create a clearance if and when there is a preceding floated block." name="assert" />
|
|
<meta content="" name="flags" />
|
|
|
|
<style type="text/css"><![CDATA[
|
|
body
|
|
{
|
|
background-color: white;
|
|
}
|
|
|
|
#parent-block
|
|
{
|
|
background-color: red;
|
|
margin-bottom: 0px;
|
|
}
|
|
|
|
#sibling
|
|
{
|
|
background-color: green;
|
|
height: 100px;
|
|
}
|
|
|
|
#element-without-clearance-applied
|
|
{
|
|
clear: both;
|
|
margin-top: 100px;
|
|
}
|
|
]]></style>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<p>Test passes if there is a wide filled green rectangle and <strong>no red</strong>.</p>
|
|
|
|
<div id="parent-block">
|
|
<div id="sibling"></div>
|
|
<div id="element-without-clearance-applied"></div>
|
|
</div>
|
|
|
|
<!--
|
|
#element-without-clearance-applied's margin-top collapses
|
|
with #parent-block's margin-bottom: the resulting margin-bottom
|
|
then collapses with the adjoining white body's margin-bottom
|
|
-->
|
|
|
|
</body>
|
|
</html> |