Multiple CSS styles for Label of input field

1
Hello team, I’d like to ask you how do you deal with styling of Labels in case of needed e.g. multiple color, font-size, font-weight, etc.?  I have the input field (drop-down in this case) with showing label I want to mark mandatory field by using red asterisk like here     Definitely it is not possible to do it via in-built design properties. I’ve also tried to insert HTML SPAN element in front of Label’s text by using jQuery. It worked but it will come to me as dirty and in addition it didn’t work for input field which visibility is based on attribute value (conditional displaying).  Any suggestion how do you handle this stuff? 
asked
2 answers
1

Hi Ivan,
you can try to do it with custom CSS, using the The ::first-letter CSS pseudo element.

You can add the * directly on the label of the specific input field. a use the css rule to edit it.

 

 

answered
1

If someone will need “to override” the style of the last character of a string, here is nice workaround

p::after {
    content: attr(data-end) ;
    color: red ;
}
<p data-end="g">Strin</p>

Source: https://stackoverflow.com/a/31038089 

answered