summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/CSS2/zindex/z-index-stack-003.xht
blob: c09ff7f2842b3d680de73a8d3ac1b0c70e7fbc5f (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
<!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: Z-index - stacking levels of positioned elements versus floated elements</title>

  <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
  <link rel="help" title="Section 9.9.1 Specifying the stack level: the 'z-index' property" href="http://www.w3.org/TR/CSS21/visuren.html#z-index" />
  <meta content="Positioned elements should be painted over floated elements. A positioned descendant with 'z-index: auto' has a greater stacking level than non-positioned floated elements." name="assert" />

  <style type="text/css"><![CDATA[
   #rel-pos-containing-block {position: relative;}

   #yellow-overlapping-abs-pos
   {
   background-color: yellow;
   height: 100px;
   left: 60px;
   position: absolute;
   top: 60px;
   width: 100px;
   z-index: auto;
   }

   #blue-first-float
   {
   background-color: blue;
   float: left;
   height: 100px;
   width: 100px;
   }

   #orange-second-float
   {
   background-color: orange;
   float: left;
   height: 100px;
   margin-left: -70px;
   margin-top: 30px;
   width: 100px;
   }
  ]]></style>

 </head>

 <body>

  <p>Test passes if the boxes are partially stacked on top of each other and if they are stacked in the following order <strong>from bottom to top: blue, orange, yellow</strong>.</p>

  <div id="rel-pos-containing-block">
   <div id="yellow-overlapping-abs-pos"></div>
   <div id="blue-first-float"></div>
   <div id="orange-second-float"></div>
  </div>

 </body>
</html>