CSS content Property
Complete CSS Reference
Definition
The content property is used with the :before and :after pseudo-elements to
generate content to attach before or after a
CSS selector.
Inherited: No
JavaScript Syntax
CSS properties can also be dynamically changed with a JavaScript.
Scripting Syntax: object.style.content="url(beep.wav)"
In our HTML DOM tutorial you can also find a full
Style Object Reference.
Example
p:before
{
content: url("beep.wav")
}
img:before
{
content: attr(alt)
}
|
Possible Values
| Value |
Description |
| string |
Defines text content. Default value is "" |
| url |
Defines a url |
counter(name)
counter(name, list-style-type)
counters(name, string)
counters(name, string, list-style-type) |
|
| attr(X) |
Defines an attribute of a selector to be displayed
before/after the selector |
| open-quote |
|
| close-quote |
|
| no-open-quote |
|
| no-close-quote |
|
Complete CSS Reference
|