Try this selector:
a:not([id*=gallery], [class*=gallery])
This will select every element athat does not have a "gallery" in its value idor its classatttribute.
Or for the full ID or class name:
a:not([id=gallery], [class~=gallery])
This will select every item athat does not have a "gallery" as its identifier or class name.
Gumbo source
share