mirror of
https://github.com/servo/servo
synced 2026-04-28 18:37:39 +02:00
40 lines
1.4 KiB
HTML
40 lines
1.4 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>
|
|
<title>CSS Test (Transforms): Containing Block for Fixed Positioning (left/top offsets)</title>
|
|
<link href="mailto:keith@keithschwarz.com" rel="author" title="Keith Schwarz" />
|
|
<link href="mailto:ayg@aryeh.name" rel="author" title="Aryeh Gregor" />
|
|
<link href="http://www.w3.org/TR/css-transforms-1/#transform-rendering" rel="help" />
|
|
<meta content=""In the HTML namespace, any value other than
|
|
'none' for the transform results in the creation of . . . a
|
|
containing block. The object acts as a containing block for fixed
|
|
positioned descendants." This means fixed-position elements need to be
|
|
rooted at a transformed ancestor, rather than the viewport." name="assert" />
|
|
<link href="reference/transform-abspos-ref.xht" rel="match" />
|
|
<style>
|
|
body > div {
|
|
width: 100px;
|
|
height: 200px;
|
|
transform: translate(50px, 50px);
|
|
background: gold;
|
|
}
|
|
body > div > div {
|
|
width: 200px;
|
|
height: 100px;
|
|
position: fixed;
|
|
left: 50px;
|
|
top: 100px;
|
|
background: navy;
|
|
color: gold;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div>
|
|
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
|
|
<div>
|
|
0 1 2 3 4 5 6 7 8 9
|
|
</div>
|
|
</div>
|
|
|
|
|
|
</body></html> |