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/

6
  • What version of Safari are you using? Somebody else observed different results in Chrome 17 and Safari 5.1: stackoverflow.com/questions/8951822/… It's generally agreed upon that it's a WebKit bug though.
    – BoltClock
    Sep 21, 2012 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, 2012 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, 2012 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, 2012 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, 2012 at 13:49

1 Answer 1

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/

Not the answer you're looking for? Browse other questions tagged or ask your own question.