Reputation: 27
I have:
<span class="field-content highlight-front">
<a href="/node/42" hreflang="en">This is an example</a>
</span>
in the css file i want to change the color of the link by using the span class.
.highlight-front{
color: blue;
}
but that doesn't seem to work. Any suggestions or places to read about targeting a link through a span class?
Upvotes: 1
Views: 11000
Reputation: 330
you can also try this
<span class="field-content">
<a class="highlight-front" href="/node/42" hreflang="en">This is an example</a>
</span>
Upvotes: 0
Reputation: 7015
add .highlight-front a{
in the class to specify all a
tags inside span
with class highlight-front
.highlight-front a{
color: blue;
}
<span class="field-content highlight-front">
<a href="/node/42" hreflang="en">This is an example</a>
</span>
Upvotes: 0
Reputation: 5719
You have to specify element inside span for colouring, which means adding a
after your class name (child of span):
Use this:
.highlight-front a{
color: blue;
}
See here:
https://plnkr.co/edit/Tn3IomLmUaobN59Cdg4j?p=preview
Upvotes: 4
Reputation: 34
You could achieve this by the following:
<span class="field-content highlight-front">
<a href="/node/42" hreflang="en">This is an example</a>
</span>
.highlight-front a{
color: blue;
}
Which will colour any <a>
found as a decendent of the .highlight-front
class.
Upvotes: -1