CSS content property

Examples

The following example will add the URL in parentheses after each link:

a: after
{
content: "(" attr (href) ")";
}


Attribute definitions and instructions

ontent attributes: before and: after pseudo-element used in conjunction to insert generated content.

Defaults: normal
inherit: no
version: CSS2
JavaScript syntax: object .style.content = "url (beep.wav)"


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the Content property.

Note: IE8 only the specified DOCTYPE supported Content property!.


Content property value

value Explanation
none Setting Content, if you specify to Nothing
normal Setting content, if specified, the normal, the default is "none" (which is nothing)
counter Set the contents of the counter
attr(attribute) As one of the attributes set Content selector.
string Setting Content to your specified text
open-quote Content is setting an opening quotation mark
close-quote Setting Content closed quotes
no-open-quote If you specify a start quotes, remove content
no-close-quote If specified, remove content closing quotation mark
url(url) Setting some media (images, sound, video, etc.)
inherit The specified value content attribute should be inherited from the parent element


related articles

CSS Reference Manual: : the before pseudo-element

CSS Reference Manual: : the After pseudo-element