{"id":14031,"date":"2011-09-05T20:36:16","date_gmt":"2011-09-06T03:36:16","guid":{"rendered":"http:\/\/css-tricks.com\/?page_id=14031"},"modified":"2021-04-23T09:38:01","modified_gmt":"2021-04-23T16:38:01","slug":"content","status":"publish","type":"page","link":"https:\/\/css-tricks.com\/almanac\/properties\/c\/content\/","title":{"rendered":"content"},"content":{"rendered":"\n
The Then an element like this:<\/p>\n\n\n\n Would render like this:<\/p>\n\n\n\n It could also be an empty string, which is commonly seen in things like the clearfix<\/a>.<\/p>\n\n\ncontent<\/code> property in CSS is used in conjunction with the pseudo-elements
::before<\/a><\/code> and
::after<\/a><\/code>. It is used to literally insert content. There are four value types it can have.<\/p>\n\n\n
String<\/h4>\n\n\n
.name::before {\n content: \"Name: \";\n}<\/code><\/pre>\n\n\n\n
<div class=\"name\">Chris<\/div><\/code><\/pre>\n\n\n\n
Name: Chris<\/code><\/pre>\n\n\n\n
Counter<\/h4>\n\n\n
div::before {\n content: counter(my-counter);\n}<\/code><\/pre>\n\n\n\n