Issue
I have this markup:
<p class='[&_a]:text-[red]'><a>hi</a> world</p>
This code adds styles to all a
tags within p
tag, but i want to add the class to all elements regardless of the fact that it is a
, 'div`,or anything else. I tried to do this:
<p class='[&_*]:text-[red]'><a>hi</a> world</p>
but it does not work.
How can I achieve what I described above?
Solution
"world" is not a child element. If you want to color it, you should use this class :
class="text-[red] [&_*]:text-[red]"
Answered By - Tom
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.