Apologies for the poorly worded question, but I am struggling to find the right terms to convey my query. Let me attempt to explain...
Is it feasible to apply different css styles based on the classes assigned to the containing element?
For example:
<div class="blue">
<a class="text">Hello</a>
</div>
<div class="red">
<a class="text">Hello</a>
</div>
In the scenario above, the "Hello"s are intended to be blue and red respectively, with their color being determined by the "text" class rather than the "red" or "blue" class they are nested in. Essentially, I am looking to have two distinct "text" classes, with the choice between them contingent on the class of the container element. Is this achievable? Thank you!