Visit Mozilla.org

CSS:content

From MDC

« CSS Reference

[edit] Summary

content property indicates what is rendered inside pseudo-elements :before and :after.

[edit] Syntax

content : normal | none | inherit | no-open-quote | no-close-quote ;
content : [ <string> | <counter> | attr(<identifier>) | <uri> 
                     | open-quote | close-quote]+ ;

[edit] Values

none
normal
<string>
<uri>
one or more URI to refer an external resource, such as an image.
<counter>
open-quote and close-quote
this will be replaced by the appropriate string from the 'quotes' property.
no-open-quote and no-close-quote
increments (decrements) the level of nesting for quotes, but no content will be added.
attr(attribute-name)
this will be replaced by the string value of node's attribute.

[edit] Examples

View Live Examples

q:lang { quotes: '"' '"' "'" "'" }
q:before { content: open-quote }
q:after  { content: close-quote }
h1:before { 
  content: "Chapter: ";
}

[edit] Notes

[edit] Specifications

[edit] Browser compatibility

Browser Lowest Version
Internet Explorer ?
Firefox ?
Netscape ?
Opera ?
Safari ?

[edit] See also

quotes