Is it possible to select css generated content? [duplicate]

No, you can’t. See Selecting and manipulating CSS pseudo-elements such as ::before and ::after using jQuery. To repeat what is described there, generated content is not part of the DOM. In the words of the CSS2.1 spec, Generated content does not alter the document tree. Generated content only exists in the visual world of the … Read more

CSS data attribute new line character & pseudo-element content value

Here is how this can work. You need to modify your data attribute as follows: [data-foo]:after { content: attr(data-foo); background-color: black; color: white; white-space: pre; display: inline-block; } <div data-foo=’First line &#xa; Second Line’>foo</div> Fiddle Demo: http://jsfiddle.net/audetwebdesign/cp4RF/ How It Works Using \a does not work, but the equivalent HTML entity does, &#xa;. According to the … Read more

CSS Pseudo Element Counters: can you increment an alphabet letter “a”, “b”, “c”, etc instead of a number?

Yes, the second argument to counter() defines the type of counter used, as for the list-style-type from a regular ul or ol; for example: content: counter(chapter, lower-alpha); ul { counter-reset: listStyle; } ul li { margin-left: 1em; counter-increment: listStyle; } ul li::before { margin-right: 1em; content: counter(listStyle, lower-alpha); } <ul> <li>one</li> <li>two</li> <li>three</li> </ul> JS … Read more

Why are double quotes shown only for the first element?

Your open quotes are not terminated, so the browser makes the “smart” assumption that you’re about to nest your quotes, resulting in double outer quotes for the first element and single inner quotes for the second. This is how quote punctuation works in nested quotations. See Wikipedia and the references to nested quotations therein. Notably, … Read more

CSS content property: is it possible to insert HTML instead of Text?

Unfortunately, this is not possible. Per the spec: Generated content does not alter the document tree. In particular, it is not fed back to the document language processor (e.g., for reparsing). In other words, for string values this means the value is always treated literally. It is never interpreted as markup, regardless of the document … Read more