content
propertyUse content
property to insert a string just before or after an element. With CSS 3, you can also use it to specify a string as the content of the element.
normal : Does not insert characters.
none : Does not insert characters. (Behaves the same as normal
).
string : String to be inserted is written with double or single quotes.
url() : Specifies the URL of an image file. The content of an element can be made into an image if content: url(image.png);
is specified.
attr() : The specified attribute value becomes the content
property value.
counter() : Inserts a counter value.
open-quote : Inserts the first pair of quotes from the quotes
property before the element.
close-quote : Inserts the second pair of quotes from the quotes
property after the element.
no-open-quote : Does not display a quotation mark but increases the level of nesting of the quotes
property by one.
no-close-quote : Does not display a quotation mark but decreases the level of the nesting of the quotes
property by one.
.Chapter h2:before { content: "Chapter " counter(ChapterNo) ". "; }
For the content()
function that is used with the string-set
property, see the section called “Variable strings : string-set
property”