Extensible HyperText Markup Language

XHTML.com recommends: PSD to HTML Slicing Service and PSD to HTML by W3 Markup. see your link here

content

Definition

The content property is used to insert content before or after an element. The screen shot below shows a heading.

Screen shot of a Web browsers shows a heading that reads 'The Period'.

The screen shot below shows text inserted via CSS before the heading.

Screen shot of a Web browsers shows a heading that reads 'Chapter: The Period'.

Example

  1. h2:before {content: 'Chapter: '}

Characteristics

Possible values

none
No content is inserted.
normal
Same as none.
string
Text content.
uri
URL to an image.
counter
Create a counter using the function counter() or counters().
attr(X)

This function returns as a string the value of an attribute where X is the attribute name. For example:

  1. abbr:after {content: attr(title)}
open-quote
This value is replaced by the appropriate string from the quotes property.
close-quote
This value is replaced by the appropriate string from the quotes property.
no-open-quote
The quotation mark is not inserted but the nesting level of the quotes property is incremented.
no-close-quote
The quotation mark is not inserted but the nesting level of the quotes property is decremented.
inherit
Use the same computed value as the parent element for this property.

Default value

normal

Applies to

Elements with :before and :after pseudo selectors

Inherited

No

See also