content – CSS: Cascading Style Sheets | MDN

The content CSS property replaces an element with a generated value. Objects inserted using the content property are anonymous replaced elements.

/* Keywords that cannot be combined with other values */
content: normal;
content: none;

/* <image> values */
content: url(“http://www.example.com/test.png”);
content: linear-gradient(#e66465, #9198e5);

/* alt text for generated content, added in the Level 3 specification */
content: url(“http://www.example.com/test.png”) / “This is the alt text”;

/* <string> value */
content: “prefix”;

/* <counter> values, optionally with <list-style-type> */
content: counter(chapter_counter);
content: counter(chapter_counter, upper-roman);
content: counters(section_counter, “.”);
content: counters(section_counter, “.”, decimal-leading-zero);

/* attr() value linked to the HTML attribute value */
content: attr(value string);

/* Language- and [...]

Read article at developer.mozilla.org

Article Taxonomies

Terms: , , , , , Keywords: