position-relative-table-caption.html (889B)
1 <!DOCTYPE html> 2 <title>position:relative should work on table captions</title> 3 <link rel="match" href="position-relative-table-top-ref.html" /> 4 <link rel="help" href="https://www.w3.org/TR/css-position-3/#rel-pos" /> 5 <meta name="assert" content="This test checks that the position:relative top constraint behaves correctly for <caption> elements"> 6 <style> 7 table { 8 border-collapse:collapse; 9 } 10 11 caption { 12 width: 50px; 13 height: 50px; 14 position: relative; 15 top: 100px; 16 background-color: green; 17 } 18 19 .group { 20 position: relative; 21 display: inline-block; 22 height: 200px; 23 } 24 25 .indicator { 26 position: absolute; 27 background-color: red; 28 left: 0; 29 top: 100px; 30 height: 50px; 31 width: 50px; 32 } 33 </style> 34 35 <div class="group"> 36 <div class="indicator"></div> 37 <table> 38 <caption></caption> 39 </table> 40 </div> 41 42 <div>You should see a green box above. No red should be visible.</div>