CSS selector for no source image

I know this is weird, but how can I select all IMGs in a document that has no source (I'm talking about a CSS selector)

That is, I want to choose

<IMG>

      

but not

<IMG src="/my_file.png">

      

Answer

img:not([src]) {
   /* style here */
}

      

+3


source to share


1 answer


You need to use a selector :not



img:not([src]) {
   /* style here */
}

      

+5


source







All Articles