This property automatically generates content to attach before/after
a CSS selector (using the :before and :after pseudo-elements.) One or more
keywords may be specified for this property, but the content does not actually
exist in the document tree; it is generated "on-the-fly." The 'display'
property is used with this property to specify the type of rendering box for
the generated content.
Allowed Values
inherit
[CSS2|CSS2.1]
[O4|S1]
Type: Explicit
Description:
Explicitly sets the value of this property to that of the parent.
normal
[CSS2.1] [O7]
Type: Explicit
Description:
For pseudo-elements, no content will be generated.
[string]
[CSS2|CSS2.1]
[N6|O4|S1]
Type: Explicit
Description:
The content of the value will be used as the generated text.
[URL]
[CSS2|CSS2.1]
[N6|O7|S1]
Type: Explicit
Description:
An absolute or relative URL pointing to an embeddable object. If rendering
of the file is not possible by the browser, it should be ignored.
[counter()|counters()]
[CSS2|CSS2.1]
[O4]
Type: Explicit
Description: counter(name) | counter(name, list-style-type)
Generated text is produced using "name" (the name of the counter at
the current point in the document tree), and "list-style-type" accepts one
of the named values used for the 'list-style-type'
property (default "list-style-type" for the counter() function is 'decimal'.)
counters(name, string) | counters(name, string, list-style-type)
All counters with the indicated "name" label at the current point
in the document tree will become the generated text, separated by the
specified string value. The counters are rendered using the "list-style-type"
(one of the named values used for the 'list-style-type'
property, default "list-style-type" for the counters() function being 'decimal'.)
open-quote|close-quote
[CSS2|CSS2.1]
[N6|O4]
Type: Explicit
Description:
A quote of the indicated type is inserted as appropriate, taking its value
from the 'quotes' property.
no-open-quote|no-close-quote
[CSS2|CSS2.1]
[N6|O4]
Type: Explicit
Description:
A quote is not inserted for the open/close quote, but the quote nesting level
is still incremented/decremented accordingly.
[attr(X)]
[CSS2|CSS2.1]
[N6|O4|S1]
Type: Explicit
Description:
This syntax returns a string which is the unparsed value of the indicated
element attribute (X) for the current CSS selector. If the specified
attribute does not exist, an empty string should be returned. Case
sensitivity of the attribute name should depend on the language in use
(eg: XML is case sensitive while HTML is not.) If the system supports it,
you can also supply a namespace prefix to narrow down the attribute selection
as well, eg: "attr(foo|align)" where "foo" is the namespace prefix,
and "align" is the attribute being selected in that namespace ONLY.
Example
Ext/Doc: em:before {
content: url("ding.wav") }
In-Line: NA
Notes
CSS2 states that newlines can be placed in generated content by using an
escape code ("\A" - the Unicode hex value for a carriage return) within the
value of a string in the 'content' property.
CSS2 also states that the content of the :before and :after pseudo-elements
will carry the same style as the element they apply to (there is no way yet
to select and apply styles to only portions of generated content.)
Although this property allows for the embedding of external URL objects, CSS2
does not allow the additional properties that are usually associated with
replaced objects, such as sizing control and accessibility descriptions.
CSS2.1 adds the "normal" value.
Browser Peculiarities
Netscape 6.x: for the [URL] syntax, I only tried a few different data
types, but I found that .gifs (and presumably other image types) work
here, but .txt and .htm data types do not.
Opera up to 6.x: this property only applied if a :before or :after pseudo-element was used.
7.x+: This property now applies to all elements and do not require pseudo-elements to apply.