after pseudo element not appearing in code

It’s because the pseudo-element isn’t generated if the content value is omitted (since the initial/default value is none). Specify a content value in order to generate the pseudo-element. A value of ” is sufficient. .product-show .readMore.less:after { content: ”; background: rgba(255, 255, 255, 0); display: block; position: absolute; bottom: 0; left: 0; width: 100%; height: … Read more

Purpose of *:before, *:after rule without content property

That applies border-box sizing to all elements as well as any :before and :after pseudo-elements that they may generate. The *:before, *:after portion means the respective pseudo-elements of any element. Once you create specific :before/:after rules later in your stylesheet, this declaration will apply automatically to all of those pseudo-elements, so you don’t have to … Read more

Can you apply a width to a :before/:after pseudo-element (content:url(image))?

You’re not crazy: it is indeed not possible to change the dimensions of an image that is inserted using content, whether it’s inserted with url(), image(), image-set(), element(), or a CSS gradient. The image is always rendered as is. This is known as replaced content, or a replaced element (except we’re not talking about elements … 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

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