simon.fraser@apple.com | 0281aee | 2012-08-27 17:39:45 +0000 | [diff] [blame] | 1 | <!DOCTYPE html> |
| 2 | |
| 3 | <html> |
| 4 | <head> |
| 5 | <style> |
| 6 | body { |
| 7 | margin: 0; |
| 8 | } |
| 9 | |
| 10 | .group { |
| 11 | display: inline-block; |
| 12 | position: relative; |
| 13 | width: 250px; |
| 14 | height: 500px; |
| 15 | } |
| 16 | |
| 17 | .container { |
| 18 | width: 200px; |
| 19 | height: 400px; |
| 20 | border: 12px solid black; |
| 21 | padding: 5px; |
| 22 | } |
| 23 | |
| 24 | .box { |
| 25 | width: 160px; |
| 26 | height: 160px; |
| 27 | } |
| 28 | |
| 29 | .sticky { |
| 30 | position: relative; |
| 31 | margin: 20px; |
| 32 | background-color: green; |
| 33 | } |
| 34 | |
| 35 | .indicator { |
| 36 | position: absolute; |
| 37 | top: 0; |
| 38 | left: 37px; |
| 39 | background-color: red; |
| 40 | } |
| 41 | </style> |
| 42 | </head> |
| 43 | <body> |
| 44 | <div class="group" style="top: -100px;"> |
| 45 | <div class="indicator box" style="top: 110px;"></div> |
| 46 | <div class="container"> |
| 47 | <div class="sticky box" style="top: 73px"></div> |
| 48 | </div> |
| 49 | </div> |
| 50 | |
| 51 | <div class="group" style="top: 0"> |
| 52 | <div class="indicator box" style="top: 37px;"></div> |
| 53 | <div class="container"> |
| 54 | <div class="sticky box"></div> |
| 55 | </div> |
| 56 | </div> |
| 57 | |
| 58 | <div class="group" style="top: 100px"> |
| 59 | <div class="indicator box" style="top: 37px;"></div> |
| 60 | <div class="container"> |
| 61 | <div class="sticky box"></div> |
| 62 | </div> |
| 63 | </div> |
| 64 | </body> |
| 65 | </html> |