Generated content

This is not a selector, but is used with the pseudo-elements ::before and ::after. There are only certain types of content that you can generate. Here is a rundown.

content

This is the content that will be placed either before or after elements:

content(none, <string>, <uri>, <counter>, open-quote, close-quote, no-open-quote, no-close-quote, attr(x))

Parameters

Following are the parameters and their description:

  • none: This parameter does not generate any content
  • normal: This is the default parameter and is the same as none
  • <string>: This is any string text content
  • <uri>: This will map to a resource, for example, an image
  • <counter>: This can be used as either the counter() or counters() function to put a counter before or after each element ...

Get Web Developer's Reference Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.