In CSS, can I add text of a different style before or after other text?
3 answers
span:after {
content: "bar";
font-style: italic;
}
This is however CSS3 and is not widely supported (yet). See 4.2. Inserting content into an element: the ":: before" and ":: after" pseudo-elements.
+9
source to share
span:after {
content:' bar';
font-style:italic;
}
This won't work in IE, albeit possibly with other user agents, and there is a limitation on what you can actually build since its inception.
Link: http://www.w3.org/TR/CSS2/selector.html#before-and-after
+4
source to share