0

I'm trying to use two pseudoelements :after, but only the first one is working:

[data-msgcounter]:after {
    background-color: #FF6969;
    background-image: -webkit-linear-gradient(#FF6969 0%, #ff0000 100%);
    background-image: -moz-linear-gradient(#FF6969 0%, #ff0000 100%);
    background-image: -o-linear-gradient(#FF6969 0%, #ff0000 100%);
    background-image: -ms-linear-gradient(#FF6969 0%, #ff0000 100%);
    background-image: linear-gradient(#FF6969 0%, #ff0000 100%);
    content: attr(data-msgcounter);
}​

[data-notcounter]:after {
    background-color: #FF6969;
    background-image: -webkit-linear-gradient(#FF6969 0%, #ff0000 100%);
    background-image: -moz-linear-gradient(#FF6969 0%, #ff0000 100%);
    background-image: -o-linear-gradient(#FF6969 0%, #ff0000 100%);
    background-image: -ms-linear-gradient(#FF6969 0%, #ff0000 100%);
    background-image: linear-gradient(#FF6969 0%, #ff0000 100%);
    content: attr(data-notcounter);
}​

Anyone have tips or a solution?

Fabrizio Calderan
  • 120,726
  • 26
  • 164
  • 177
user3571412
  • 105
  • 1
  • 9
  • 1
    could you also post the markup and show the issue in a fiddle? – Fabrizio Calderan Feb 16 '15 at 13:27
  • 1
    let me guess.. are these styles for a single element? – Mr_Green Feb 16 '15 at 13:27
  • 3
    If so, this is a duplicate of [What happens if multiple classes of the same element define a :before pseudo-element?](http://stackoverflow.com/questions/14111751/what-happens-if-multiple-classes-of-the-same-element-define-a-before-pseudo-ele) - the only differences being attribute selectors instead of classes, and :after instead of :before, neither of which are pertinent. – BoltClock Feb 16 '15 at 13:28

0 Answers0