'How to target html tag element with :v-deep() selector?

When I use:

::v-deep img { ... }

it works but I get a deprecation warning:

[@vue/compiler-sfc] ::v-deep usage as a combinator has been deprecated. Use :deep(<inner-selector>) instead.

How do I do the same thing but with :v-deep(img)?

:v-deep(img) { ... }

results in unknown pseudo selector error.

Edit:

If I could target a class I would but in my case I'm trying to target html tags inside a rich text editor to which classes can not be applied.



Solution 1:[1]

You are putting v- before deep because of which you're getting unknown selector error try out this piece of code

:deep(img){
/* Your styles  */
}

Solution 2:[2]

:deep(.child-class) {
    background-color: #000;
}

You can read more info here

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Abbas Shaikh
Solution 2 LastM4N