CSS2.1 pseudo-selectors such as ::after
and ::before
allows to add text content to the page. For example :
CSS
Actually it is possible to use content
property directly on elements, and not on pseudo-elements only. Try
p { content:'My hero is' }
in Opera and you'll see the result you wanted. The thing is other browsers don't support it yet.
A lot of other interesting things concerning generated content cat be found in CSS3 Generated and Replaced Content Module, but we'll have to wait a bit until browser venrors implement it.