2

Possible Duplicate:
Combine CSS Attribute and Pseudo-Element Selectors?

http://jsfiddle.net/BC3Td/

I have tested this in firefox and opera and there are no issues, however chrome, safari and mobile safari all ignore the second pseudo element css and default to the first, can anyone shed light on what is happening here?

and how can this be achieved without adding classes/id's?

ANSWER:

This is a webkit bug, the fix is relatively simple, if you add the following css (or any css rule that involves purely the (non-pseudo) element then it will fix itself.

#test-div a[href*="tel"],
#test-div a[href*="mail"] { display:block; }

How weird?

updted (working) fiddle is here: http://jsfiddle.net/BC3Td/3/

Community
  • 1
  • 1
Jai
  • 2,096
  • 5
  • 25
  • 37
  • What version of Safari are you using? Somebody else observed different results in Chrome 17 and Safari 5.1: http://stackoverflow.com/questions/8951822/combine-css-attribute-and-pseudo-element-selectors It's generally agreed upon that it's a WebKit bug though. – BoltClock Sep 21 '12 at 13:27
  • the lastest version, i just saw that answer actually, and it provides the fix, i shall consider this question answered, could someone link it to the other question as a duplicate? – Jai Sep 21 '12 at 13:29
  • Safari 5.1.7 for Windows is behaving improperly, not sure how comparable it is to the Mac version. – cimmanon Sep 21 '12 at 13:32
  • 1
    The question is considered "answered" only when you accept a solution below. If you solved it yourself, please post the solution below and accept it. If it's a duplicate, flag it for moderator attention. – Sparky Sep 21 '12 at 13:35
  • @Jai: I've closed it for you. In future you can click flag and let the moderators know that you'd like it to be closed as a duplicate. – BoltClock Sep 21 '12 at 13:49
  • This appears to have been fixed in Chrome, but it's hard to tell, since the question and answer are both vague as to what they're doing, and just point to different versions of the same fiddle. – Teepeemm Mar 30 '15 at 20:43

1 Answers1

0

Sounds like a bug in Webkit selection. The psudeo selector does work if the element is also selected directly however (an effective no op used here):

http://jsfiddle.net/BC3Td/2/

Matt Whipple
  • 7,034
  • 1
  • 23
  • 34