Page 1 of 1

Possible bug on complex CSS selector?

Posted: Thu Oct 11, 2018 12:30 am
by TomHTML
The validator complains that this CSS selector is invalid, yet the W3 HTML and CSS checkers approve it (and it works for styling my elements):

Code: Select all

.block .block-content a[href*="//"][target*="_blank"]:not(.image-overlay):not([href*="example.com"])::after
It complains about *="example.com", stating:
There should be a valid attribute selector ([att=value]), class selector (.class), ID selector (#id), or psuedo-class (:class) here.
But this is what I need, and it does work: I'm excluding elements with an href containing "example.com" anywhere in the href string. Is there a preferred way to do this that is different than this formulation, or is this a bug? (I have version 18.0300).

Many thanks,
Tom

Re: Possible bug on complex CSS selector?

Posted: Thu Oct 11, 2018 9:36 am
by Albert Wiersch
Hi Tom,

Yes, sorry. It is a bug. I first discovered it while developing CSS HTML Validator 2019. I've back-ported a fix to the current download of CSS HTML Validator Standard 2018.

If you download CSS HTML Validator Standard 2018 then you should get v18.0331 or above. The system's update check won't detect this update yet but you should get the update if you download it here:
https://www.htmlvalidator.com/download/ ... ionin=1801

Please let me know if that fixes the problem.

Re: Possible bug on complex CSS selector?

Posted: Thu Oct 11, 2018 9:44 am
by TomHTML
Thanks! I've installed and run it, and the bug seems to be patched! Many thanks!

Re: Possible bug on complex CSS selector?

Posted: Thu Oct 11, 2018 10:09 am
by Albert Wiersch
Great! And you're very welcome!