I'm trying to apply basic Label style to the labels in my application. For this, I defined this simple ProjectName.css file:
This is the Class where I try to set the style to the labels:
And in my ProjectName.html file I have the following line to specify the use of my css definitions:
The problem is that the labels won't take any of the styling defined in the css file.
When I inspect the DOM of one of the labels, I get this:
Where it seems like the css class values are not being passed to the final page code...
Can you please help me figuring out how to make this work?
Thanks
Code:
HeaderTitle { font-size: 3em; color: #FFFFFF; text-align: left; }
Code:
import com.smartgwt.client.types.Alignment; import com.smartgwt.client.types.Overflow; import com.smartgwt.client.widgets.Img; import com.smartgwt.client.widgets.Label; import com.smartgwt.client.widgets.layout.HLayout; public class HeaderArea extends HLayout { private static final String FONT_COLOR = "#FFFFFF"; private static final String BACK_COLOR = "#002748"; private static final String LOGO_FILE = "logo_focuss_blanco.png"; private static final String LOGO_AND_TITLE_PERC = "90%"; private static final int LOGO_SIZE = 50; String userName = "Admin"; public HeaderArea() { super(); this.setBackgroundColor(BACK_COLOR); HLayout westLayout = new HLayout(); westLayout.setWidth(LOGO_AND_TITLE_PERC); westLayout.setLayoutLeftMargin(20); westLayout.setMembersMargin(20); HLayout eastLayout = new HLayout(); eastLayout.setLayoutRightMargin(20); westLayout.addMember(new Img(LOGO_FILE, LOGO_SIZE, LOGO_SIZE)); westLayout.addMember(createLabel("ProjectName", "HeaderTitle")); eastLayout.addMember(createLabel(userName, "HeaderTitle")); this.addMember(westLayout); this.addMember(eastLayout); } private Label createLabel(String title, String style) { Label label = new Label(title); label.setStyleName(style); return label; } }
Code:
<link type="text/css" rel="stylesheet" href="ProjectName.css">
When I inspect the DOM of one of the labels, I get this:
Code:
<div id="isc_W" eventproxy="isc_Label_0" style="POSITION:relative;-webkit-margin-collapse:separate separate;VISIBILITY:inherit;Z-INDEX:200540;CURSOR:default;"><table role="presentation" cellspacing="0" cellpadding="0" width="100" height="54"><tbody><tr><td class="HeaderTitle" align="left" valign="middle" style="">Simulador AA</td></tr></tbody></table></div>
Can you please help me figuring out how to make this work?
Thanks
Comment