In the stylesheet, try adding "!Important" after the CSS code you wish to implement and before the ";"
For example, color: #054768 !important; font-family: Tahoma !important; font-size: 11px !important; Also, if you plan to change it dynamically, you will need to use addClass / removeClass - as I do not believe setCls works after the textfield is rendered. -----Original Message----- From: [email protected] on behalf of brendan Sent: Wed 3/4/2009 5:10 PM To: GWT-Ext Developer Forum Subject: trouble applying CSS style I've been trying to style a TextField widget, specifically, the built- in label that appears to the left of the box. I am including the CSS in the HTML page, and have confirmed that other things (I believe mainly GWT widgets, not Ext) are styling properly, and have inspected with Firebug. However when I try to apply style a TextField nothing occurs. Here's the code that constructs the text field. postalCodeLine = new TextField(); String preStyle = postalCodeLine.getCls(); postalCodeLine.setLabel(langProp.locationLabel()); //postalCodeLine.setStyleName("generaltext"); postalCodeLine.addClass("generaltext"); //postalCodeLine.setCls("generaltext"); //postalCodeLine.addStyleName("generaltext"); //postalCodeLine.setStyle( // "color: #054768; font-family: Tahoma, \"Lucida Sans Unicode \","+ // "\"Lucida Grande\", Arial, Verdana, sans-serif; font-size: 11px;" // ); String postStyle = postalCodeLine.getCls(); Window.alert("PRE: "+preStyle); Window.alert("POST: "+postStyle); postalCodeLine.setEmptyText(langProp.locationEmptyText()); Alert windows said PRE: null ... POST: generaltext As you can see, we tried several different methods before resorting to inline styling, none of them worked. The label still appears as black text. Any help would be appreciated. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "GWT-Ext Developer Forum" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/gwt-ext?hl=en -~----------~----~----~----~------~----~------~--~---
<<inline: winmail.dat>>
