blob: 5a134c570da63a24fd2eae325130ae18d931770c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
|
<!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: Containing Blocks - Block-level elements position based on left-to-right direction and parent element is relative</title>
<link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
<link rel="author" title="Alan Gresley" href="alan{at}css-class.com" />
<link rel="author" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact"/>
<link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#containing-block-details" />
<meta name="flags" content="dom interact" />
<meta name="assert" content="The containing block of an absolutely positioned block-level element is formed by the padding edge of its nearest (closest) positioned ancestor element." />
<style type="text/css">
div
{
border: solid silver;
direction: ltr;
margin-bottom: 20px;
padding: 100px;
width: 450px;
}
#first-box, #last-box
{
color: silver;
}
.position
{
height: 30px;
position: absolute;
width: 30px;
}
#tl-control
{
border-top: 30px solid red;
margin-left: -50px;
margin-right: 20px;
padding: 20px 15px;
}
#br-control
{
border-bottom: 30px solid red;
margin-left: 20px;
margin-right: -50px;
padding: 20px 15px;
}
.top-left
{
background: green;
left: 0;
top: 0;
}
.bottom-right
{
background: green;
bottom: 0;
right: 0;
}
#test
{
border: 5px solid silver;
padding: 50px;
position: relative;
}
</style>
</head>
<body>
<p>Test passes if there is no red visible on the page.</p>
<div>
<span id="test">
<span id="first-box"><span id="tl-control"></span>Filler Text Filler Text Filler Text Filler Text</span>
<span class="position bottom-right">BR</span>
<span class="position top-left">TL</span>
<span id="last-box">Filler Text Filler Text Filler Text Filler Text<span id="br-control"></span></span>
</span>
</div>
</body>
</html>
|