absolute-fixed-in-legend.html (1041B)
1 <!DOCTYPE html> 2 <title>Absolute/fixed-positioned boxes in LEGEND should be painted on the fieldset content</title> 3 <link rel=match href=absolute-fixed-in-legend-ref.html> 4 <style> 5 .absolute-container { 6 position: relative; 7 border: none; 8 padding: 0; 9 margin: 0; 10 } 11 12 .absolute-container .legend-content { 13 display: block; 14 font-size: 32px; 15 position: absolute; 16 left: 0px; 17 background: lime; 18 width: 10em; 19 } 20 21 .fixed-container { 22 contain: paint; 23 border: none; 24 padding: 0; 25 margin: 0; 26 } 27 28 .fixed-container .legend-content { 29 display: block; 30 font-size: 32px; 31 position: fixed; 32 left: 0px; 33 background: lime; 34 width: 10em; 35 } 36 37 .fieldset-content { 38 background: red; 39 font-size: 32px; 40 width: 10em; 41 } 42 </style> 43 44 <fieldset class="absolute-container"> 45 <legend><span class="legend-content">legend</span></legend> 46 <div class="fieldset-content">content</div> 47 </fieldset> 48 49 <fieldset class="fixed-container"> 50 <legend><span class="legend-content">legend</span></legend> 51 <div class="fieldset-content">content</div> 52 </fieldset>