开发者

Can there be two different styles applied to a single component

开发者 https://www.devze.com 2023-03-16 21:32 出处:网络
HTML lb = new HTML(); lb.setHTML(\"Hi <BR> Thanks&Regards\"); i know lb.setStyleName(\"style\");
HTML lb = new HTML();
lb.setHTML("Hi <BR> Thanks&Regards");

i know lb.setStyleName("style"); Now this "style" will appear for the entire lb component.

For some specific reason i need Hi to have a different style and Thanks & Regards to hav a different style.

I know that we have can two d开发者_StackOverflow中文版ifferent labels and set two different text and styles But its creating problem to the logic .

Not sure whether this possible


I think this should make it:

HTML lb = new HTML();
lb.setHTML("<span class='hi-style'>Hi</span> <BR> <span class='thanks-style'>Thanks&Regards</span>");
0

精彩评论

暂无评论...
验证码 换一张
取 消