position-absolute-semi-replaced-stretch-button-ref.html (421B)
1 <!DOCTYPE html> 2 <style> 3 .cb { 4 position: relative; 5 border: 3px solid black; 6 height: 100px; 7 width: 150px; 8 display: inline-block; 9 vertical-align: top; 10 margin: 5px; 11 } 12 .abs { 13 margin: 0; 14 position: absolute; 15 box-sizing: border-box; 16 top: 3px; 17 left: 3px; 18 outline: 2px solid lime; 19 width: calc(100% - 6px); 20 height: calc(100% - 6px); 21 } 22 </style> 23 <div class="cb"><button class="abs">button</button></div>