Label cssStyle does not work

0
0

Hi,

i have a normal Label and i want to set its font-size, font-family using CssStyle, but only color works

label.CssStyle=”font-family:Tahoma;color:red;font-size:50px”;

Is it a bug or by design?

Thanks for your help,

Page

 

 

  • You must to post comments
0
0

Yep, you are right. It’s as designed since the font property and the color properties also set the style. Use the Font property and the ForeColor property instead. Or use a css class and add the !important css marker. For inline styles you cannot override the inline styles set by the existing properties.

You can add a css class in a plain standard .css file in default.html or using the stylesheet component.

.test {
font-size:20pt !important;
}

label1.CssClass = “test”;

Images below are at runtime.

Attachment
  • You must to post comments
0
0

Hi,

CssStyle for label works only in design, in runtime it goes back to normal.

Page

  • You must to post comments
0
0

Works well. See image. You may be setting the Font property somewhere in the app. In general it’s better to use the existing properties instead of css directly.

Attachment
  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.