auto-margins-002.html (1047B)
1 <!DOCTYPE html> 2 <title>css-flexbox: Tests that we correctly align an image with auto margins and max-height</title> 3 <link rel="author" title="Google LLC" href="https://www.google.com/"> 4 <link rel="help" href="https://drafts.csswg.org/css-flexbox/#auto-margins" title="8.1. Aligning with 'auto' margins"> 5 <link rel="match" href="../reference/ref-filled-green-100px-square.xht"> 6 7 <p>Test passes if there is a filled green square and <strong>no red</strong>.</p> 8 9 <!-- we position this div on top of the flexbox to cover up the red where 10 we expect it to be; letting the red in the wrong places shine through --> 11 <div style="position: absolute; height: 100px; width: 100px; z-index: 1;"> 12 <div style="height: 25px; background: green;"></div> 13 <div style="height: 50px; background: transparent;"></div> 14 <div style="height: 25px; background: green;"></div> 15 </div> 16 <div style="width: 100px; height: 100px; background: red; display: flex;"> 17 <img src="support/300x150-green.png" style="margin: auto; max-width: 100%; max-height: 100px;"> 18 </div>