Here’s a HTML reference https://www.w3.org/TR/CSS2/selector.html#pseudo-elements
(honest question) As someone who used pseudo before/after in my own code, I'd be interested in their potential downsides or issues.
Because sometimes the best way to style something is by using a character (bullet points, arrows, ...). Example: you could add a symbol to URLs by giving <a> a slight padding on the left and by adding an image showing an URL symbol. But by using 🔗 in a:before, you cheaply get vector graphics, and a symbol which (in a perfect world) will always match the font.
* { user-select: none }
now entire page is for display. What is content and what is meta decided by consumer, author can guide, medium creates obstacles. <blockquote> does not copy quotes. Some pages present link as <a href=foo>foo</a>, it would be nice to use a::after { content: '(' attr(href) ')' }
but it is not selectable. A lot of pages present anchor as <a>¶</a> on hover, can't be done with CSS. What is missing is *::before, *::after { user-select: text }
Nope, it does not work.Best tool so far is XSLT, I've written prototype that mimics CSS syntax
quote {
content-before: '"'
content-after: '"'
}
a {
content-after: '(' @href ')'
}
h2 {
content-before: <a href=@href>¶</a>
}
Anyone interested? <style type="text/css">
.code-line::before {content: '>>> ';}
</style>
<div class="code-line">print 12</div>
<div class="code-line">a = [i**2 for i in range(10)]</div>
Then the reader can copy the actual code without the interpreter's prompt.There needs to be a CSS property that makes the visible text selectable and copyable.