flexbox-with-pseudo-elements-001.html (1443B)
1 <!DOCTYPE html> 2 <!-- 3 Any copyright is dedicated to the Public Domain. 4 http://creativecommons.org/publicdomain/zero/1.0/ 5 --> 6 <!-- Testcase to ensure we handle ::before and ::after pseudo-elements on 7 a flex container and treat them as flex items (e.g. honoring "align-self", 8 and not merging them into anonymous flex items formed around text). 9 --> 10 <html> 11 <head> 12 <title>CSS Test: Testing that generated content nodes are treated as a flex items</title> 13 <link rel="author" title="Daniel Holbert" href="mailto:dholbert@mozilla.com"> 14 <link rel="help" href="http://www.w3.org/TR/css-flexbox-1/#flex-items"> 15 <link rel="match" href="flexbox-with-pseudo-elements-001-ref.html"> 16 <meta charset="utf-8"> 17 <style> 18 .flexContainer { 19 display: flex; 20 align-items: flex-end; 21 justify-content: space-between; 22 height: 50px; 23 width: 300px; 24 margin-bottom: 2px; 25 background: lightgray; 26 } 27 div.withBefore::before { 28 align-self: center; 29 content: 'b'; 30 background: yellow; 31 } 32 div.withAfter::after { 33 align-self: center; 34 content: 'a'; 35 background: lightblue; 36 } 37 </style> 38 </head> 39 <body> 40 <div class="flexContainer withBefore"> 41 x 42 <div>y</div> 43 z 44 </div> 45 <div class="flexContainer withAfter"> 46 x 47 <div>y</div> 48 z 49 </div> 50 <div class="flexContainer withBefore withAfter"> 51 x 52 <div>y</div> 53 z 54 </div> 55 </body> 56 </html>