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
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.
Hi,
CssStyle for label works only in design, in runtime it goes back to normal.
Page
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.
Please login first to submit.