shape-outside-linear-gradient-016.html (2421B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <title>CSS Test: Test float with linear gradient under writing-mode: vertical-lr and text-orientation: sideways</title> 5 <link rel="author" title="Brad Werth" href="mailto:bwerth@mozilla.com"/> 6 <link rel="author" title="Mozilla" href="http://www.mozilla.org/"> 7 <link rel="help" href="http://www.w3.org/TR/css-shapes-1/#shapes-from-image"/> 8 <link rel="help" href="http://www.w3.org/TR/css-shapes-1/#shape-outside-property"/> 9 <link rel="help" href="http://www.w3.org/TR/css-shapes-1/#shape-margin-property"/> 10 <link rel="match" href="reference/shape-outside-linear-gradient-001-ref.html"/> 11 <meta name="fuzzy" content="maxDifference=0-1; totalPixels=0-8700" /> 12 <meta name="flags" content="ahem"/> 13 <meta name="assert" content="This test verifies that shape-outside respects a simple linear gradient with shape-margin under vertical-lr and text-orientation: sideways."/> 14 <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" /> 15 <style type="text/css"> 16 .container { 17 writing-mode: vertical-lr; 18 text-orientation: sideways; 19 inline-size: 100px; 20 block-size: 200px; 21 background-color: red; 22 font-family: Ahem; 23 font-size: 50px; 24 line-height: 1; 25 } 26 #test { 27 color: green; 28 } 29 #float-left { 30 /* Note: In .container's writing-mode, "float: left" actually floats 31 us towards the top. */ 32 float: left; 33 inline-size: 100px; 34 block-size: 200px; 35 background: linear-gradient(to bottom, green 50%, transparent 50%); 36 shape-outside: linear-gradient(to bottom, green 25%, transparent 25%); 37 shape-margin: 25%; 38 } 39 #float-right { 40 /* Note: In .container's writing-mode, "float: right" actually floats 41 us towards the bottom. */ 42 float: right; 43 inline-size: 100px; 44 block-size: 200px; 45 background: linear-gradient(to top, green 50%, transparent 50%); 46 shape-outside: linear-gradient(to top, green 5%, transparent 5%); 47 shape-margin: 45% 48 } 49 </style> 50 </head> 51 <body> 52 <p> 53 The test passes if you see a green square. There should be no red. 54 </p> 55 <div id="test" class="container"> 56 <div id="float-left"></div> 57 x x x x 58 </div> 59 <div id="test" class="container" style="direction: rtl;"> 60 <div id="float-right"></div> 61 x x x x 62 </div> 63 </body> 64 </html>