M
M
master2909882020-04-18 12:51:53
css
master290988, 2020-04-18 12:51:53

How to exclude id using not pseudo-element?

Hello!

There is a code:

a[href^="http://"]:not([href*="site.ru"]):not([class]):after,
a[href^="https://"]:not([href*="site.ru"]):not([class]):after {
  content: "" url('/images/external.png');
  padding-left:5px;
}


It allows you to exclude all classes, but you need to exclude IDs too, how to implement this correctly?
In my case, you need to exclude #hotlog_counter
In general, it's better that all id be applied.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Sarvarov, 2020-04-18
@master290988

To exclude a specific ID:

a[href^="http://"]:not([href*="site.ru"]):not([class]):not(#hotlog_counter):after, 
a[href^="https://"]:not([href*="site.ru"]):not([class]):not(#hotlog_counter):after {

}

To exclude all elements with at least some ID:
a[href^="http://"]:not([href*="site.ru"]):not([class]):not([id]):after, 
a[href^="https://"]:not([href*="site.ru"]):not([class]):not([id]):after {

}

Well, in general, you are trying to make some strange selectors ...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question