<q-carousel-slide
class="black-bg"
:name="1"
img-src="https://cdn.quasar.dev/img/mountains.jpg"
>
<div class="text-h5 text-white">Lacak Posisi Anda</div>
</q-carousel-slide>
I want to apply class black-bg only to q-carousel-slide without affecting the div.
If the div has a transparent or translucent background, or if it inherits its background from its parent, then nothing you can do to the q-carousel-slide element will change that.
If the stylesheet (or JavaScript) has rules which target descendants or children of elements which are members of a particular class, then nothing you can do to the HTML will change that.
(Obviously, moving the div so it to somewhere where it won't be affected by the above would work, but I doubt that's an option for you).