display-contents-before-after-001.html (814B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>CSS Display: Generated ::before and ::after on display:contents</title> 4 <link rel="author" title="Rune Lillesveen" href="mailto:rune@opera.com"> 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 div { display: contents } 11 .p::before { content: "P" } 12 .a::before { content: "A" } 13 .s::after { content: "S" } 14 </style> 15 <p>You should see the word PASS below.</p> 16 <div><!-- 17 --><div><div class="p"></div></div><!-- 18 --><div></div><!-- 19 --><div class="a"></div><!-- 20 --><div>S<div class="s"></div></div> 21 </div>