content

The content CSS property is used with the ::before and ::after pseudo-elements to generate content in an element. Objects inserted using the content property are anonymous replaced elements.

Values

none
The pseudo-element is not generated.
normal
Computes to none for the :before and :after pseudo-elements.
<string>
Text content.
<uri> url()
The value is a URI that designates an external resource (such as an image). If the resource or image can’t be displayed, it is either ignored or some placeholder shows up.
<counter>
[fixme] Counters may be specified with two different functions: ‘counter()’ or ‘counters()’. The former has two forms: ‘counter(name)’ or ‘counter(name, style)’. The generated text is the value of the innermost counter of the given name in scope at this pseudo-element; it is formatted in the indicated style (‘decimal’ by default). The latter function also has two forms: ‘counters(name, string)’ or ‘counters(name, string, style)’. The generated text is the value of all counters with the given name in scope at this pseudo-element, from outermost to innermost separated by the specified string. The counters are rendered in the indicated style (‘decimal’ by default). See the section on automatic counters and numbering for more information. The name must not be ‘none’, ‘inherit’ or ‘initial’. Such a name causes the declaration to be ignored.
attr(X)
Returns the value of the element’s attribute X as a string. If there is no attribute X, an empty string is returned. The case-sensitivity of attribute names depends on the document language.
open-quote | close-quote
These values are replaced by the appropriate string from the quotes property.
no-open-quote | no-close-quote
Introduces no content, but increments (decrements) the level of nesting for quotes.

<!DOCTYPE html>
<html>
    <head>
        <style>
            a:after {
                content: " (" attr( href) ")";
            }
        </style>
    </head>
    <body>
        <p>
            <a href="http://www.loopandbreak.com">programming tutorials</a>
            contains free tutorials and references.
        </p>
        <p>
            <b>Note:</b>
            IE8 supports the content property only if a !DOCTYPE is specified.
        </p>
    </body>
</html>