I'm wondering if it's possible to have certain pieces of 'static' text in the css3 instead of in the HTML, just like one can also have 'background-image' in css3 ?
I have searched on Google but cannot seem to find any reference to this.
I'm wondering if it's possible to have certain pieces of 'static' text in the css3 instead of in the HTML, just like one can also have 'background-image' in css3 ?
I have searched on Google but cannot seem to find any reference to this.
Pseudo selectors like :before and :after can specify a content property, which can be text.
p:before {
content: "this will appear before all paragraph content";
}
Put simply, no, not like a background-image
.
You may use :before
/:after
selectors with the content
property, but that wouldn't work like a background image, it would place the text either before or after the element.
Fiddle demo: http://jsfiddle.net/YkerN/ and support table: http://caniuse.com/#feat=css-gencontent (IE8+; no problems in other browsers)