fit-content-contribution-001.html (955B)
1 <!DOCTYPE html> 2 <link rel="help" 3 href="https://drafts.csswg.org/css-sizing-3/#valdef-width-fit-content-length-percentage"> 4 <link rel="match" href="../reference/ref-filled-green-100px-square.xht" /> 5 <meta name="assert" 6 content="max-width: fit-content works when there is no definite available size. Chrome 105 treated fit-content as min-content in this scenario."> 7 <style> 8 #reference-overlapped-red { 9 position: absolute; 10 background-color: red; 11 width: 100px; 12 height: 100px; 13 z-index: -1; 14 } 15 16 .word { 17 float: left; 18 width: 50px; 19 } 20 21 </style> 22 23 <p>Test passes if there is a filled green square and <strong>no red</strong>. 24 </p> 25 26 <div id="reference-overlapped-red"></div> 27 28 <div style="width: 100px;"> 29 <div style="float: left; height: 100px; background: green;"> 30 <div style="max-width: fit-content;"> 31 <div class="word"></div> 32 <div class="word"></div> 33 <div class="word"></div> 34 </div> 35 </div> 36 </div>