function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Anu YadavAnu Yadav 

adding font for custom Label value.

I have a custom Label Address_State with Value "State *". I want to display "State" in black and "*" in Red color in Lightning page. Please suggest.
Best Answer chosen by Anu Yadav
@Amit Kumar Giri@Amit Kumar Giri
You will not be able to use html inside field label/custom label. eariler this was possible but salesforce stopped supporting this sometime back. i dont know why but its no more possible. I too tried to use this and after sometime going through different post realized that its no more supported

All Answers

Raj VakatiRaj Vakati
I think you nee to use the style class to do it but you can try it as below 

use format() with labels and update the * in-between span tag .. change the styles to span tage 
Anu YadavAnu Yadav
Hi Raj,

Can you give me an example snippet.
I tried using span in Custom label as below:
User-added image

and tried fetching in my lightning page:
<lightning:select class="inputWidth slds-p-bottom_small" value="{!v.state}" label="{!$Label.c.State}" name="State" aura:id="state"  onchange="{!c.onStateChange}">

But its not working for me.
User-added image

I have tried using <Font> tag also. it also didnt work.
@Amit Kumar Giri@Amit Kumar Giri
You will not be able to use html inside field label/custom label. eariler this was possible but salesforce stopped supporting this sometime back. i dont know why but its no more possible. I too tried to use this and after sometime going through different post realized that its no more supported
This was selected as the best answer