absolute-non-replaced-max-001.html (972B)
1 <!doctype html> 2 <meta charset="utf-8"> 3 <title>CSS Test: ‘max-width’ and ‘max-height’ affect percentage sizes in descendants</title> 4 <link rel="author" name="Delan Azabani" href="mailto:dazabani@igalia.com"> 5 <link rel="help" href="https://drafts.csswg.org/css2/#min-max-widths"> 6 <link rel="help" href="https://drafts.csswg.org/css2/#min-max-heights"> 7 <link rel="match" href="absolute-non-replaced-max-001-ref.html"> 8 <meta name="assert" value="This test verifies that when the used ‘width’ and ‘height’ are affected by ‘max-width’ and ‘max-height’, the descendants are laid out with a containing block of the new size, so any percentage sizes are resolved against that new size."> 9 <p>Test passes if there is a green square containing a smaller black square below. 10 <div style="position: absolute; width: 4em; height: 4em; max-width: 2em; max-height: 2em; background: green;"> 11 <div style="width: 50%; height: 50%; background: black;"></div> 12 </div>