CSS:content
From MDC
[edit] Summary
content property indicates what is rendered inside pseudo-elements :before and :after.
- Initial value:
normal - Applies to:
:beforeand:afterpseudo-elements - Inherited: no
- Percentages: n/a
- Media: all
- Computed value:
[edit] Syntax
content : normal | none | inherit | no-open-quote | no-close-quote ;
content : [ <string> | <counter> | attr(<identifier>) | <uri>
| open-quote | close-quote]+ ;
[edit] Values
nonenormal<string><uri>- one or more URI to refer an external resource, such as an image.
<counter>- open-quote and close-quote
- this will be replaced by the appropriate string from the 'quotes' property.
- no-open-quote and no-close-quote
- increments (decrements) the level of nesting for quotes, but no content will be added.
- attr(attribute-name)
- this will be replaced by the string value of node's attribute.
[edit] Examples
q:lang { quotes: '"' '"' "'" "'" }
q:before { content: open-quote }
q:after { content: close-quote }
h1:before {
content: "Chapter: ";
}
[edit] Notes
[edit] Specifications
- W3C Cascading Style Sheets, level 2 revision 1
- W3C Cascading Style Sheets, level 2
- W3C Cascading Style Sheets, level 3
[edit] Browser compatibility
| Browser | Lowest Version |
|---|---|
| Internet Explorer | ? |
| Firefox | ? |
| Netscape | ? |
| Opera | ? |
| Safari | ? |