Combine CSS Attribute and Pseudo-Element Selectors?

This looks like a bug, which has finally been reported. If you add a CSS rule for divCombine CSS Attribute and Pseudo-Element Selectors? anywhere in your stylesheet with at least one declaration, your divCombine CSS Attribute and Pseudo-Element Selectors?:after rule will magically apply. For example: div:after { content: “NO”; } divCombine CSS Attribute and Pseudo-Element … Read more

Adding text before list

You need CSS counters: #customlist { /* delete default counter */ list-style-type: none; /* create custom counter and set it to 0 */ counter-reset: elementcounter; } #customlist>li:before { /* print out “Element ” followed by the current counter value */ content: “Element ” counter(elementcounter) “: “; /* increment counter */ counter-increment: elementcounter; } <ol id=”customlist”> … Read more

CSS3 transitions on pseudo-elements (:after, :before) not working?

WebKit (Chrome, Safari) does not support transitions on pseudo elements. https://bugs.webkit.org/show_bug.cgi?id=23209 http://code.google.com/p/chromium/issues/detail?id=54699 It should work in Firefox. Edit: The issue in WebKit is now resolved. The patch allready landed in Chrome Carnery, so it will be supportet from version 26 on. I don’t know about Safari.

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

What is the difference between pseudo-classes and pseudo-elements?

From https://developer.mozilla.org/en-US/docs/Learn/CSS/Introduction_to_CSS/Pseudo-classes_and_pseudo-elements Pseudo-class : A CSS pseudo-class is a keyword, preceded by a colon (:), added to the end of selectors to specify you want to style the selected elements, and only when they are in certain state. For example, you might want to style an element only when it is being hovered over by … 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

prevent a pseudo element from triggering hover?

The following css does the trick for modern browsers (not IE10-): .b:after { pointer-events: none; } pointer-events: none allows elements to not receive hover/click events. See this fiddle. Caution pointer-events support for non-SVG elements is in a relative early state. developer.mozilla.org gives you the following warning: The use of pointer-events in CSS for non-SVG elements … Read more