Align text in ui.text

Hi webix team,
I want in my Code Snippet center the text in the box but this works not for me. I’m happy for a tip.
Best regards
Rainer

Hello RainerRoss

To center the text in the box you need to apply text-align: center !important; to the input because by default this input has inline style text-align: left;.
Inline styles will always have the highest specificity level.
So to rewrite this inline style you need to use the important flag ( !important ).

Please check the example: Code Snippet

Hi Natalia,
thx a lot for the tip - it works now very good!

Out of curiosity, why not use inputAlign: "center" in the definition of the text view instead of doing it with CSS? (code snippet here: Code Snippet)

I usually try my best to avoid the use of !important because they eventually end-up clashing one with another.

Hope this helps!
=o)