Home > Blockchain >  How to target html tag element with :v-deep() selector?
How to target html tag element with :v-deep() selector?

Time:04-14

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.

CodePudding user response:

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  */
}

CodePudding user response:

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

You can read more info here

  • Related