overflow-wrap-min-content-size-001.html (1316B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>CSS Text Test: overflow-wrap: anywhere and intrinsic sizing</title> 4 <link rel="author" title="Florian Rivoal" href="http://florian.rivoal.net/"> 5 <link rel="help" href="https://drafts.csswg.org/css-text-3/#overflow-wrap-property"> 6 <link rel="match" href="reference/overflow-wrap-min-content-size-001-ref.html"> 7 <meta name="assert" content="Soft wrap opportunities introduced by overflow-wrap:anywhere **are** considered when calculating min-content intrinsic sizes."> 8 <link rel="stylesheet" type="text/css" href="/fonts/ahem.css"> 9 <style> 10 table { 11 font: 20px/1 Ahem; 12 overflow-wrap: anywhere; 13 max-width: 0; 14 border: 0; 15 border-collapse: collapse; 16 } 17 td { 18 padding: 0; 19 background: green; 20 color: transparent; 21 } 22 #red { 23 font: 20px/1 Ahem; 24 position: absolute; 25 z-index: -1; 26 background: red; 27 color: transparent; 28 } 29 </style> 30 31 <p>Test passes if there is a green box below and no red. 32 <div id=red>X<br>X<br>X<br>X</div> 33 <table><tr><td>XXXX</table> 34 35 <!-- 36 width:min-content on the div directly without using a table 37 would achieve the goal of this test, and be a lot simpler. 38 39 However, width:min-content is not yet widely supported. 40 41 Using a table, and forcing it to be as small as possible 42 will achieve min-content sizing of the div in all browsers. 43 -->