cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Help us improve the PTC Community by taking this short Community Survey! X

I am facing problem in providing color to text in label widget using css code .

sanjanabalaji
11-Garnet

I am facing problem in providing color to text in label widget using css code .

I am facing problem in providing color to text in label widget using CSS code .i WILL PROVIDE THE CODE BELOW :

 

.simple-label {
width: auto;
height: auto;
display: flex;
color: red;
font-weight: 400;
line-height: 14px;
}

8 REPLIES 8

Hello,

 

Why don't you use Style property of the widget instead? If you reuse your Style objects consistently, it will be more flexible and easier to maintain in the long-run.

 

/ Constantine

I want to try it using CSS code.Please give me some suggestions

Hi,

 

This will work (change CSS class in label widget):

 

.label-text {
width: auto;
height: auto;
display: flex;
color: red;
font-weight: 400;
line-height: 14px;
}

 

Best regards,

Raluca Edu

No .it did not work if i change the css class too

In 8.4.4 worked, what version are you using?

8.4 version

Please attach xml export of simple mashup to look into.

 

Thanks,

Raluca Edu

@sanjanabalaji In your original example, add ".label-text" to the CSS selector like that:

.simple-label .label-text {
    width: auto;
    height: auto;
    display: flex;
    color: red;
    font-weight: 400;
    line-height: 14px;
}

The custom CSS class is applied to the DIV, which encloses the SPAN with "label-text" (not to the SPAN itself), so you need to specify an explicit CSS selector to override "label-text" parameters (dark-gray color, bold, etc.)

 

/ Constantine

Top Tags