[SalesForce] Change the font color of a lightning:formattedUrl

The automatic color of my link using a lightning:formattedUrl is not black and I am trying to change it to the color black. Is there a way to do this, I have tried adding it in the class with color:black and color:#000000 and both did not work. I have also tried fixing with a div around the lightning:formattedUrl block and that did not work either. This is an aura lightning component and NOT a lightning web component.

Best Answer

I tried to use div around the lightning:formattedUrl like you and it worked. Can you show your code?

<aura:component >
    <div>
        <lightning:formattedUrl class="blackColor" value="www.salesforce.com" />
    </div>
</aura:component>


.THIS .blackColor a{
    color: black !important; 
}

enter image description here