<br> and ::after or ::before
From this accepted answer : Which elements support the ::before and ::after pseudo-elements?
As you can read here http://www.w3.org/TR/CSS21/generate.html, :after only works on elements that have a (document tree) content.
<input>
has no content, as well as<img>
or<br>
.
Not funny, have you considered doing this with an image?
content: url(image.jpg)
This saying, i was designing something with ::before for a background-overlay on hover on an anchor.
I HAD to specify css content to empty {content=""} otherwize not displaying.
The :before
and :after
pseudo-elements are vaguely defined and poorly supported for elements like input
. Your CSS code is not invalid, just not supported in browsers and not really defined in specs.
In an editor, which must be JavaScript-driven I presume, you can simply insert “↩” characters in the DOM (and remove them later if needed). Note, however, that “ ↩” has limited font support; a small image, scaled to the font size, might work better.