I have an HTML element as follows
<a class="button">Click</a>
In my .scss file i have the following code.
.button{
& a{
color:red;
&:hover,
&:visited{
color:blue;
}
}
}
The above code does not work.
I tried searching for terms such as "targeting sibling class using css" but the results show for scenarios as given below.
<a>
<span class="button">Click</span>
</a>
How do i target the a
tag using the button class ?
Update :
I am not trying to target the parent element. I need to target the element which has the particular class is used.