svg-root-as-flex-item-004.html (1103B)
1 <!DOCTYPE html> 2 <title>SVG root as flex item</title> 3 <link rel="author" title="David Grogan" href="mailto:dgrogan@chromium.org"> 4 <link rel="help" href="https://drafts.csswg.org/css-flexbox/#algo-main-item" title="Part E"> 5 <link rel="help" href="https://www.w3.org/TR/css-sizing-3/#intrinsic-sizes" title="For boxes with an intrinsic aspect ratio, but no intrinsic size"> 6 <link rel="match" href="../reference/ref-filled-green-100px-square.xht"> 7 <meta name="assert" content="SVG's intrinsic width when used as flex base size stretches into the available size when it has no specified intrinsic sizes and is passed through the aspect ratio " /> 8 9 <style> 10 #reference-overlapped-red { 11 position: absolute; 12 background-color: red; 13 width: 100px; 14 height: 100px; 15 z-index: -1; 16 } 17 </style> 18 19 <p>Test passes if there is a filled green square and <strong>no red</strong>.</p> 20 21 <div id="reference-overlapped-red"></div> 22 23 <div style="display: flex; flex-direction: column; width: 100px; align-items: flex-start;"> 24 <svg viewBox="0 0 200 200"> 25 <rect width="100%" height="100%" fill="green" /> 26 </svg> 27 </div>