display-contents-before-after-003.html (1001B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>CSS Display: Generated ::before and ::after with display:contents inside flex</title> 4 <link rel="author" title="Rune Lillesveen" href="mailto:futhark@chromium.org"> 5 <link rel="help" href="https://drafts.csswg.org/css-display-3/#valdef-display-contents"> 6 <link rel="match" href="display-contents-pass-ref.html"> 7 <style> 8 /* Disable kerning because kerning may differ for different node tree. */ 9 html { font-kerning: none; font-feature-settings: "kern" off; } 10 .flex { display: inline-flex; flex-direction: column } 11 .flex::before { display: contents; content: "A" } 12 .flex::after { display: contents; content: "S" } 13 </style> 14 <!-- The before and after pseudo elements do not generate boxes due to 15 display:contents, so that their generated text content constitutes a 16 contiguous sequence of child text runs which means they end up in the same 17 flex item. --> 18 <p>You should see the word PASS below.</p> 19 P<div class="flex"></div>S